---
title: "Treat data from other APIs as untrusted · Agent Wranglers"
url: https://agentwranglers.se/playbook/application-security/requests-files-and-caches/third-party-api-data
id: APS-42
level: Recommended
updated: 2026-10-27
build: a2a6bdfed830
tokens: 633
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Treat data from other APIs as untrusted

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Requests, files and caches](https://agentwranglers.se/playbook/application-security/requests-files-and-caches.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-27.

- ID: APS-42
- Level: Recommended
- Chapter: [Requests, files and caches](https://agentwranglers.se/playbook/application-security/requests-files-and-caches.md)
- Rule: Check and limit what comes back from partner and third-party APIs, as you would for user input.
- Check: Point a staging integration at a test server that returns a huge body, a redirect to an internal address and a field holding `<b>PENTEST</b>`. The app refuses or escapes all three.
- How: Call partners only over HTTPS with certificate checks on. Validate each response against a schema, and cap its size and time. Never follow their redirects blindly, and never pass their data into queries, pages or shells unescaped. Then [parse it once at the boundary](https://agentwranglers.se/playbook/architecture/data-shapes/parse-at-the-boundary.md) into typed objects.

## Sources

- [OWASP API10:2023 Unsafe Consumption of APIs](https://api-security.owasp.org/editions/2023/en/0xaa-unsafe-consumption-of-apis/)

## Related rules

- API-75 [Wrap each outside API in one adapter](https://agentwranglers.se/playbook/api-design/using-other-companies-apis/one-adapter-per-api.md) in API design
- ARC-53 [Parse input once at the boundary](https://agentwranglers.se/playbook/architecture/data-shapes/parse-at-the-boundary.md) in Clean code and architecture

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/application-security/requests-files-and-caches/third-party-api-data">Agent Wranglers application security playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Fetch only allowed addresses](https://agentwranglers.se/playbook/application-security/requests-files-and-caches/block-server-side-request-forgery.md)
- Next: [Check every uploaded file](https://agentwranglers.se/playbook/application-security/requests-files-and-caches/safe-file-uploads.md)
- [Requests, files and caches](https://agentwranglers.se/playbook/application-security/requests-files-and-caches.md)
