How do you defend an agent that processes untrusted content?
Assume content can carry instructions. Keep it as data in tagged blocks, screen user input and tool outputs with a lightweight model, and return a stripped summary or an error when injection is suspected. Limit and gate actions that could leak data or cause damage. Red-team with planted injections before launch, and monitor outputs afterwards.
How do you make destructive actions impossible rather than unlikely?
Enforce in layers outside the model: least-privilege credentials, deny rules (managed settings org-wide), PreToolUse hooks that fail closed, sandboxed execution and network egress limited by a proxy. In CI on untrusted code, run `claude -p --bare` so the checkout's hooks and MCP servers don't load.
Never ship keys in browser or mobile code: call the API from your back end. Use workspace-scoped developer keys per environment, and keep Admin keys for organisation management only. Inject credentials into agents through a proxy outside their boundary. Rotate leaked keys at once and monitor usage. MCP servers must validate that tokens were issued to them, with no token passthrough.