AI Coding Agent Security
AI coding agent security for Claude Code, Cursor, Codex and Copilot
Find the coding agents on developer laptops, tie each to a verified developer and check and record what they do against your policy.
Works with
- Claude Code
- Claude Desktop
- Cursor
- Codex
- GitHub Copilot
- Gemini CLI
Coding agents now read whole codebases, run commands, open pull requests and query production through MCP servers. They work with the developer's access and on the developer's laptop, using tools the developer picked.
AI coding agent security is the set of controls that finds the coding agents developers run, ties each one to a verified developer, decides every tool call, model request and on-device action against policy, and records what each agent did. It is the working half of coding agent governance, and it is what lets you say yes to Claude Code, Cursor, Codex and GitHub Copilot instead of banning them. For how agents authenticate and are authorized on each call, see AI agent identity and authorization.
- Developers keep the coding agents they like, with one line of setup
- Security sees every agent and MCP server, with a name behind each
- Every action is checked against your policy and logged in Agent Trail
The gap
Coding agent security gaps your existing controls miss
Network controls, endpoint protection and code scanning were built for people and for code. An agent acting with a developer's access falls between them. Most of what a coding agent does happens where those controls don't look.
Unapproved agents and MCP servers
Developers install coding agents and add MCP servers on their own. Security often finds out after the fact, if at all.
Full developer access
An agent runs with the developer's access to repositories, tickets, cloud consoles and production databases, not just what the task needs.
Secrets in agent context
Keys committed to a repo or sitting in a workspace file land in the agent's context, and from there in prompts sent to a model.
Tools that change after approval
An MCP server's tool definitions can change after you approve them, and the agent follows the new instructions.
Local actions no gateway sees
A local agent connecting to a local MCP server, or running a git command, stays on the laptop, out of reach of network controls.
Credentials that outlive their owner
Shared API keys and personal tokens keep working after a developer changes teams or leaves the company.
Bans on coding agents rarely last. It works better to let them run and record each action against a named developer and a rule.
How it works
How AI coding agent security works on every call
Agent Authority puts a decision on every path a coding agent takes: on the laptop itself, at the MCP gateway in front of your tools, and at the LLM gateway in front of your models. Each decision knows the developer, the agent, the tool and what the call is trying to do.
The three paths are three parts of one product. Endpoint Authority covers the laptop, MCP Authority the tools and LLM Authority the models, all under one policy and one trail.
- The sensor on the laptop finds the agent and its MCP servers
- The agent is tied to the developer signed in through your IdP
- Tool calls pass the MCP gateway, model requests the LLM gateway
- Policy decides each call; risky local actions stop on the device
- Agent Trail records every decision with the rule that made it
- ModelOn the team's approved list
- PromptKeys and tokens removed
- BudgetWithin the team's budget
- CCClaude Code create_pull_request on githubMCP gatewayAllowed
- CuCursor delete_branch on githubMCP gatewayBlocked
- CuCursor connect mcp://local-postgresOn the laptopBlocked
- CCClaude Code prompt to an approved modelLLM gatewayRedacted
- CCClaude Code tool call over 200 an hourMCP gatewayThrottled
Five decisions, not just allow or deny
Every call a coding agent makes ends in one of five decisions, and each one is written to Agent Trail with the rule that made it.
- AllowWithin policy, it runsClaude Code opens a pull request against main.
- RedactIt runs, sensitive data removedA file read comes back with AWS keys and GitHub tokens replaced by redaction labels.
- ThrottleHeld to its limitsEach Claude Code instance gets 200 tool calls an hour, and is refused once the budget runs out.
- Ask a personHeld for approval with CIBAA delete waits for the developer to approve it on their own device.
- DenyBlocked and recordedCursor is stopped from connecting to an unapproved local MCP server.
Find every coding agent and MCP server on developer laptops
Endpoint Authority runs a sensor on each laptop and shows which coding agents are installed and running on every developer machine, including the ones people set up themselves, and the MCP servers those agents connect to.
Roll the sensor out with the device management you already use, such as Jamf or Intune. Sensors on CI runners, in early access, report the agents that run in your pipelines too, and everything they find lands in NHI Inventory. For finding unapproved AI across the whole company, not only coding agents, see shadow AI.
- Claude Code, Claude Desktop, Cursor, Copilot, Codex and Gemini CLI
- Local MCP servers flagged when they aren't on your approved list
- Connections to outside MCP servers, with the agent that opened them
- Where each agent sends data, with new destinations highlighted
Claude Code permissions
Beyond Claude Code permissions and Cursor settings: one policy for every agent
Coding agents ship with their own permission settings, such as allow and deny rules for tools and commands. They are a useful first line, but each agent keeps them in its own format, they don't know your identity provider's groups, and how strictly they apply depends on how each developer runs the agent. Agent Authority enforces one policy outside the agent, for every agent.
| Control | Agent Authority | Agent settings |
|---|---|---|
| One policy across Claude Code, Cursor, Codex and CopilotThe same rules apply to every agent, on the laptop and at the gateway, instead of one settings file per tool. | Agent AuthorityYes | Agent settingsPer agent |
| Rules written once against your identity provider's groupsUse the groups you already keep in Okta, Microsoft Entra ID or Ping Identity. | Agent AuthorityYes | Agent settingsPer tool |
| MCP tool calls checked down to the argumentsConditions look inside the request, such as a result limit or the size of a request body. | Agent AuthorityYes | Agent settingsTool names |
| Sanctioned and unsanctioned agents treated differentlyThe same developer can use the GitHub tools from a sanctioned agent and be refused delete-branch from any other. | Agent AuthorityYes | Agent settingsNo |
| Downstream credentials never reach the agentA scoped token is swapped for the real credential at the moment of the call. | Agent AuthorityYes | Agent settingsIn local config |
| MCP tools that change after approval are blocked | Agent AuthorityYes | Agent settingsNo |
| Secrets, PII and PHI redacted before the agent sees them | Agent AuthorityYes | Agent settingsNo |
| Unapproved agents and MCP servers found on the laptop | Agent AuthorityYes | Agent settingsNo |
| Offboarding in your identity provider cuts off the agents | Agent AuthorityYes | Agent settingsToken by token |
| Every decision recorded with the developer and the rule | Agent AuthorityYes | Agent settingsPer-agent logs |
Scope each coding agent to its task, on the laptop and at the gateway
Give each agent only what its task needs, and at most what the developer it works for can do. Let an agent read a repository and open pull requests while it is refused branch deletes or writes to production.
- Rules by developer and group, by agent and by the arguments inside the call
- On-device rules for actions that skip the gateway, such as git commands
- Each agent tied to the developer signed in through your identity provider
- Agents hold only a scoped token, swapped for the real credential at call time
- Anomalies and open findings can deny an agent's next call
How each agent gets its identity and a scoped token is covered in AI agent identity and authorization.
Control which MCP tools coding agents use, and block tools that change
Put MCP servers behind one gateway and give developers a sanctioned way to ask for more. Developers request the tools they need, an admin approves them, and each developer connects with their own work login through MCP OAuth.
MCP Authority also watches the tool definitions it approved. If a server's tools change, the tool is blocked until an admin re-approves it. This blocks a rug pull, where an approved tool is quietly edited to send its results somewhere else, and it catches silent schema drift when a vendor updates its server.
- A catalog of 50+ MCP servers, plus your own by URL
- One gateway for the company, or a virtual gateway per team
- Approved tools that change are blocked until an admin re-approves them
- Every call checked against the developer and the agent making it
Stop prompt injection and secret leaks in coding agents
A coding agent reads files, issues and web pages it didn't write, and any of them can carry instructions. Agent Authority catches instructions hidden in documents, tools or web content before the agent acts on them, and filters what the agent reads before it reads it.
A key committed to a repository is redacted from the file read, so it stays out of the agent's context and the model behind it, and secret detection stops keys, tokens and passwords from leaving in prompts or tool calls. Redaction policies can be scoped to particular MCP servers and tools, such as the file and code-search tools on your code hosts.
- Prompt injection hidden in tool output caught before the agent acts on it
- Pattern filters for AWS keys, GitHub and GitLab tokens, plus an AI judge
- PII and PHI redacted in structured fields and free text, beyond regex
- Works with your third-party redaction and AI guardrails
- Redactions logged as counts only; the log keeps the count and discards the matched text
Approved models and spend caps for coding agents
Coding agents use the models you approve, within the budget you set. LLM Authority sits between coding agents and the model providers, so each team or developer can have its own approved models and its own budget.
Each agent's activity and spend is baselined, so a sudden spike shows up as an anomaly. For AI spend across the whole company, see AI adoption and cost controls.
- Models from OpenAI, Anthropic, Google Gemini, Azure OpenAI and Amazon Bedrock
- Spend shown by team, developer and model; requests stop at the budget
- Rate limits per agent instance, so a looping agent is throttled
Audit every coding agent action in Agent Trail
Every tool call a coding agent makes is recorded in Agent Trail with the agent, the developer it acted for, the tool, the MCP server and the decision, including the policy that made it.
When an agent needs to be stopped, contain it on its own: revoke, downscope or stop a single agent instance in one step, while the developer and every other agent keep working. Revocation takes effect on the agent's next call, before its token expires.
- Every allow, redaction, throttle, approval and denial, with the rule and the reason
- Blocked on-device actions logged with the developer and the agent
- Webhooks to Splunk HEC, Datadog, CrowdStrike Next-Gen SIEM, PagerDuty, Slack and Teams
Developers keep the coding agents they already use
Developers keep the agents they like and change very little. There is no agent rewrite and no SDK: pointing an agent at the MCP gateway is one line in its MCP configuration, and each developer signs in once with their own work login.
- One line in .cursor/mcp.json or the agent's own MCP config
- No new browser and no proxy change on the laptop
- Self-service requests for new MCP servers, instead of tickets
{
"mcpServers": {
"secureauth": {
"url": "https://<your-host>/gateway/mcp"
}
}
}Buyer's checklist
Six checks for choosing an AI coding agent security platform
These questions show whether a platform governs coding agents or only watches them. Ask them of any vendor, including us.
| What to ask | How Agent Authority answers |
|---|---|
| What to askDoes it find unregistered agents and MCP servers?You can't scope what you can't see. | How Agent Authority answersA laptop sensor finds coding agents and local MCP servers, and sensors on CI runners, in early access, report the agents that run there. |
| What to askDoes it know which person is behind each agent?Investigations and offboarding start from a name. | How Agent Authority answersEach agent is tied to the developer signed in through your identity provider, with the groups you already have. |
| What to askHow deep do its rules go, and what can it decide?Server-level allow or deny lets an agent do anything a tool allows. | How Agent Authority answersPolicy checks the person, the agent, the server, the tool and the arguments on every call, and can Allow, Redact, Throttle, Ask a person or Deny. |
| What to askCan it act where no gateway sits?Local agents and MCP servers run only on the laptop. | How Agent Authority answersOn-device checks stop risky actions on the laptop before they run, with the same rules for every agent. |
| What to askDoes it protect secrets and catch changed tools?Data leaves through what the agent reads, and a vendor's update can change a tool you already approved. | How Agent Authority answersResponses are redacted before the agent sees them, prompt injection in tool output is caught, and an approved tool that changes is blocked until re-approved. |
| What to askCan your SOC use the record?A log helps when your team acts on it. | How Agent Authority answersAgent Trail records every decision, and webhooks send events to Splunk, Datadog, CrowdStrike, PagerDuty, Slack or Teams. |
Go deeper
The capabilities behind coding agent security
- Endpoint AuthorityThe laptop sensor: shadow AI, local MCP servers, on-device checks
- MCP AuthorityThe MCP gateway: catalog, per-person sign-in, argument-level policy
- LLM AuthorityThe model gateway: approved models, budgets, prompt protection
- NHI InventoryOne register of every agent and the keys and tokens it uses
Governing every agent in the company, not only coding agents? See agentic AI governance.
AI coding agent security FAQ
What is an AI coding agent security platform, and what is coding agent governance?
An AI coding agent security platform finds the coding agents developers run, such as Claude Code, Cursor, Codex and GitHub Copilot, ties each one to a verified developer, decides every tool call, model request and on-device action against policy, and records what each agent did. Coding agent governance is the program those controls support: knowing which agents run in your company, who each one works for, what each one may do and how it is offboarded, with an audit trail your security team and auditors can use. SecureAuth Agent Authority covers both, on laptops, at the MCP gateway and at the LLM gateway.
How do you secure Claude Code in the enterprise?
Limit what it can reach. It runs with the developer's access to code, secrets and tools, so the enterprise question is what it is allowed to do with that access. With Agent Authority, a sensor on each laptop finds Claude Code and the MCP servers it uses and ties it to the developer signed in through your identity provider. Its MCP tool calls are checked by MCP Authority down to the tool and its arguments, risky local commands are stopped on the device, its model requests can go through LLM Authority for approved models and budgets, and every decision is recorded in Agent Trail.
How should you set Claude Code permissions, and what if developers skip the permission prompts?
Give each agent only what the task needs, and at most what the developer it works for can do: read access to the repositories and tickets they work on, write actions such as opening a pull request where needed, and no destructive actions, such as deleting branches or writing to production, unless a rule allows them. A coding agent's own permission settings are a useful first line, but they live with each agent and each developer. Agent Authority's decisions don't depend on them: the MCP gateway decides every tool call it carries and the laptop sensor checks local actions before they run, so the same rules apply whatever permission mode the developer runs the agent in.
How do you stop prompt injection in Claude Code, Cursor and other coding agents?
Catch the instructions before the agent acts on them, and limit what a hijacked agent could do. Agent Authority can run an AI judge on tool output that redacts instructions aimed at an AI assistant hidden in documents, tools or web content, such as a request to ignore previous instructions. Because every tool call is still decided against policy, an agent that has been steered by injected text is held to the same rules: it can't call a tool it isn't allowed, use arguments a condition forbids or reach an unapproved MCP server, and the attempt is recorded in Agent Trail.
How do you stop a coding agent from leaking secrets or source code?
Filter what the agent sees and watch where it sends data. Agent Authority redacts responses from MCP servers before the agent sees them: pattern filters catch known formats such as AWS access keys and GitHub tokens, and an AI judge handles what a pattern can't describe, in structured fields and free text alike. Secret and credential detection stops keys, tokens and passwords from leaving in prompts or tool calls, and the laptop sensor shows where each agent sends data, with new destinations highlighted. Redactions are logged as counts only, so the log keeps the count and discards the matched text.
How do you stop a malicious or changed MCP tool (a rug pull)?
Treat a changed tool as a new tool. In a rug pull, an MCP tool a developer's coding agent already uses is altered after approval, for example to slip in an instruction that sends results somewhere else. MCP Authority notices when an approved server's tool definitions change and blocks the tool until an admin re-approves it, so the agent can't call the altered version in the meantime. The same check catches silent schema drift when a vendor updates its server.
How do you find shadow coding agents and MCP servers on developer machines?
Look on each developer's laptop. The Endpoint Authority sensor shows the coding agents installed and running and flags local MCP servers missing from your approved list. The shadow AI use case covers discovery across the whole company.
How do you secure Cursor, Codex, GitHub Copilot and Gemini CLI as well as Claude Code?
With the same policy. The laptop sensor finds Claude Code, Claude Desktop, Cursor, GitHub Copilot, Codex and Gemini CLI, and the same on-device rules apply to each of them. MCP Authority works with any MCP-capable agent you point at the gateway, so Cursor security and Claude Code security are one set of rules, and policy can still treat each agent differently, even for the same developer.
What happens to a developer's coding agents when they leave the company?
Their agents are cut off when their account is. Agent Authority ties every coding agent to the developer's identity-provider account, so offboarding them, for example in Okta, ends their agents' access too. Because each developer reached MCP servers with their own work login and the downstream credentials stayed with Agent Authority, there's no shared key left to find and rotate.
Do developers need to change how they work?
Very little. Developers keep their editor, their coding agent and their workflow, with no agent rewrite and no SDK to add. Connecting Cursor, Claude Code or another agent to the MCP gateway takes one line in its MCP configuration, such as .cursor/mcp.json, and each developer signs in with their own work login. IT rolls out the laptop sensor through Jamf or Intune, with no new browser and no proxy change.
How do you evaluate an AI coding agent security solution?
Check six things: discovery of unregistered agents and MCP servers; a verified person behind every agent, authenticated through your identity provider; rules that reach the tool and its arguments, with more outcomes than allow or deny; control on the device where no gateway sits; secret redaction, prompt injection defense and changed-tool blocking; and a record of every decision your SOC can use. SecureAuth Agent Authority covers all six for Claude Code, Cursor, Codex, GitHub Copilot and Gemini CLI, with Okta, Microsoft Entra ID, Ping Identity or SecureAuth as the identity provider.
Start securing AI coding agents
14-day free trial with your own Agent Authority tenant. Connect your identity provider, point one agent at the gateway and watch its first calls land in Agent Trail.
Updated