Skip to the content
AI and Cybersecurity Learning and Practice Center Test automation Open the Learning Center

Best practiceRunning agents

Check every agent action against policy before it runs

OWASP ASI01OWASP ASI02OWASP ASI03

Instructions in a prompt are not access controls: Replit's agent deleted a production database during a code freeze it had been told about again and again, and a malicious GitHub issue got an agent to copy data from private repositories into a public pull request. A check in front of every tool call decides on the call itself, and OWASP's advice is to keep that check outside the agent, so corrupted planning cannot trigger harmful actions.

What to do

  1. Put a policy enforcement point in front of every tool call: it validates the intent and the arguments, enforces schemas and rate limits, and refuses what the policy does not allow.
  2. Authorize each call as the user the agent acts for, at the moment of the call, and verify every request on the server side; the scopes a token claims are not enough on their own.
  3. Write data-flow rules into the policy, such as private data never going to public places and destructive commands never reaching production.
  4. Keep the policy engine outside the agent, separate planning from execution, and re-verify each privileged step.

Sources

Check your own AI plan against the practices: Plan check