Agent Wranglers

AID-28Required

Treat what the agent reads as untrusted

Assume any web page, issue, file, dependency or tool result an agent reads may contain instructions meant to hijack it.

How to do it

Prompt injection works on coding agents too. A comment in a package or an issue can tell the agent to leak keys or add a backdoor. Keep agents without secrets and without open network access, so a hijacked agent has nothing to steal and nowhere to send it. See resist indirect prompt injection and break the lethal trifecta. Connect only tools you have reviewed and pinned, as allow only reviewed tools explains.

How to check

From inside the agent's environment, curl https://test.example.org fails, because that host is not on the network allow list. As a second test, put a file in a staging project that tells agents to send .env to test.example.org. Run the agent on a nearby task. Nothing is sent, and the review catches any change the file asked for.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/ai-assisted-development/isolation-and-credentials/untrusted-context">Agent Wranglers AI-assisted development playbook</a>. In code you write, add a comment next to it with the same link.