What is AI agent security?
AI agent security is keeping agents from being used to do harm, by mistake or on purpose. An agent reads company data and calls tools that change real records, so a wrong or hijacked step has a real effect. The work is limiting what each agent can reach and keeping a record of what it did.
Why are AI agents a different security problem?
A normal application does what its code says. An agent decides what to do next, from instructions and from whatever it reads along the way. Three things follow:
- Its input is its attack surface. Any text an agent reads, from an email to a web page to a support ticket, can carry instructions.
- It acts with real credentials. To be useful it needs access to the CRM, the ticketing system or the database, and whatever it can reach, a bad step can reach.
- Its behavior isn’t fixed. The same agent can take a different path tomorrow, so you can’t review the code once and call it safe. You have to limit the damage and watch the calls.
What are the main risks to an AI agent?
- Over-broad credentials. The agent holds a login with more access than its job needs, so one bad step reaches far.
- Prompt injection. Hidden instructions in a document, email or web page redirect the agent to do something its owner never asked for.
- Tools that return or change too much. A tool that can read every record or delete data gives a mistaken agent more room to cause damage.
- Credential leakage. If the agent holds a key, it can repeat that key in a reply, a log or a prompt to another system.
- Untrusted tools and servers. A tool from an unknown source can describe itself one way and behave another. An MCP server you didn’t vet is a way in.
- Data leaving where it shouldn’t. An agent that reads sensitive records and can also send messages or call outside services can carry the data out.
- Agents nobody tracks. Agents built by individuals or teams, with no owner on record and no log, are the ones that cause trouble unseen. See shadow AI.
How do you secure AI agents?
Five controls cover most of it:
- Narrow tools. Give each agent only the operations its job needs. A support agent that reads tickets doesn’t need to delete accounts.
- Credentials the agent never sees. A gateway holds the credential and makes the call, so the agent can’t leak or reuse it.
- Approval for actions that can’t be undone. A person confirms deletes, payments and bulk changes. This is human in the loop.
- A log of every call. Each call is recorded with who or what made it, which tool, and what came back, so you can review it and shut an agent off.
- An owner for every agent. Someone is named for each agent, knows what it can do, and reviews it on a schedule.
Where do the controls sit?
Put the controls outside the agent, because the agent is the part an attacker is trying to influence. An instruction in a prompt such as “never delete anything” is a request, and an injected instruction can override it. A control in the layer between the agent and the tool is enforced no matter what the agent was told.
That layer is a gateway. The agent asks for a tool by name. The gateway checks that this agent may use it, adds the credential, makes the call, and writes the log entry. The agent gets the result and nothing else. Read more in MCP gateway and agent gateway.
What does it look like in practice?
A sales assistant agent answers “what’s the status of the Acme renewal?” It needs to read one account in the CRM and read the last few support tickets. It doesn’t need to edit opportunities, export contacts or send email.
With narrow tools, it gets two read operations and nothing else. Suppose a support ticket contains a hidden line telling the agent to export every contact and send the list outside the company. The agent may try, but no export tool exists for it and no send tool exists for it. The call can’t be made, and the attempt shows up in the log.
How do you choose an AI agent security platform?
Ask any vendor these questions:
- Can I scope a tool to specific operations, not just a whole app?
- Does the agent ever hold the credential, or does the platform hold it?
- Is every call logged, with the agent, the tool and the result, and can those logs go to my SIEM?
- Does it cover the apps I already run, or only the few that ship their own MCP server?
- Can I see every agent, including the ones built outside the security team?
- Do the controls apply to agents built on any framework, or only the vendor’s own?
How is AI agent security different from AI agent governance?
Security stops an agent from being turned against you, and it usually belongs to the security team. AI agent governance is the wider rulebook: who owns each agent, what it may do, what needs approval and how it is reviewed. The two share the same controls, so most teams run them together.
How is AI agent security different from MCP security?
MCP security is the same job at the server. An MCP server usually holds a credential to a system such as the CRM, so the questions are who can call it, which tools it exposes and whether every call is recorded. Agent security covers the agent as well, including what it is told to do.
What should you do first?
Start with an inventory. List the agents your teams run, what each can reach and who owns it. Then take away every permission an agent doesn’t use, move credentials out of the agents and into a gateway, and turn on logging. Those three steps remove most of the risk before any new tooling.
AI agent security at Tray
Agent Gateway sits between agents and the tools they call. Any of the 12,000+ apps, databases, APIs, and services Tray connects to can become an MCP tool with scoped operations and held credentials, and every call is logged. So can any API with an OpenAPI spec, through the CDK. Governance applies the same controls across both Tray products, and logs stream to your SIEM or log tool.