If you've shipped an AI agent to production in the last year, you've probably already felt the gap between "this works in the demo" and "this is safe to run unsupervised." Agentic AI systems that plan, call tools, and take actions with minimal human input breaks a lot of assumptions that traditional app security is built on. Here are five mistakes developers keep making, and what to do instead.

1. Treating the agent's credentials like a service account

It's tempting to give your agent one API key with broad scope because it's simpler to wire up. Don't. An agent's permissions should be the intersection of what the current task needs and what it's allowed to touch not a static grant that covers every possible future task.

In practice: issue short-lived, scoped tokens per task. Separate read access from write/send access by default, and require an explicit elevation path for anything destructive. If your agent can read a database and also send emails, that's two separate credentials, not one.

2. Not distinguishing user input from ingested content