AI agent security for every agent your company runs

AI agent security means controlling who an agent is and who it acts for, what it can reach, what it sends out and what gets logged. Formal is an AI agent security platform that enforces those checks outside the agent: on laptops, in cloud sandboxes and on the MCP tool path.

agents · acmeexample
# each request carries the agent and the person behind it
VERIFY  cursor-cloud-agent  -> maya@acme.com (OIDC)
ALLOW   leo (terminal)      git push acme/payments
BLOCK   claude-code for leo git push acme/payments
BLOCK   devin for sam       mergePullRequest acme/api#412

The problem

AI agent security risks start with borrowed access

A coding agent runs with the engineer’s keys, network and repositories. Cloud agents get API keys in their environment. To the systems on the other end, the agent and the person look like one user.

  1. The agent acts as the engineer

    Claude Code pushes with the engineer's SSH key and GitHub token. GitHub sees the same user for the agent's push and the person's.

  2. Keys sit inside the sandbox

    A long-lived API key in an environment variable is readable by every process in the sandbox, including whatever the agent decides to run.

  3. Allowed domains still leak

    “Going from 0.0.0.0/0 to an allowlist felt like progress, until we realized every allowed domain is still an exfiltration channel.”
    Kevin Qiu, Lead Security Engineer, Latent Health
today · no policy on the pathexample
01
claude-code · leogit push origin mainALLOWED
02
sandbox · run 4821printenv OPENAI_API_KEYALLOWED
03
agent · prodPOST api.github.com/gistsALLOWED

# Without a check outside the agent, all three go through.

Why Formal

One control plane for agent policy

As an AI agent security platform, Formal is two proxies and one control plane.

Checks that sit outside the agent

Claude Code, Cursor and Codex ship their own permission prompts and sandboxes, configured per agent on the machine the agent runs on. Formal adds checks outside the agent: the Endpoint on that machine’s network path, and the Connector in front of the databases, APIs and MCP servers the agent reaches.

Rego policies, managed in one place

The Endpoint and the Connector enforce policies written in Rego, managed in one place with the OIDC integrations, the Catalog, Workflows and the logs.

Cloud agent access tied to a person

Cursor uses that combination to tie cloud agent access back to a person. “We’ve limited the amount of data that those cloud agents can access and we’re able to tie that back to the specific user who is using that cloud agent, which is a feature that I’m only aware of Formal having.” Roy Xu, Software Engineer, Security, Cursor.

Cursor case study ›

What an agent actually touched

The Access Graph maps humans, agents and machines to the Connectors and resources they reached. It’s built from observed traffic, not granted permissions, so it shows what an agent actually touched, which is a different question from what its role allows.

Dry-run, backtest, then enforce

For an enterprise AI agent security rollout, we’d start every new policy in dry-run, backtest it on retained traffic, and turn it on once the matches look right. Any version can be rolled back.

Rolled out with your MDM and IdP

The Endpoint deploys through Jamf Pro, Kandji, Fleet, Mosyle, Rippling or Intune. People sign in through Okta, Entra ID, Google Workspace, OneLogin or JumpCloud.

Where your agents run

Where your agents run, and what Formal checks there

An agent on a laptop, an agent in a cloud sandbox and an agent calling MCP tools need different enforcement points. The Endpoint runs where the agent runs. The Connector sits in front of what it reaches.

Engineer laptops

Tell the agent from the engineer

In Transparent Mode on macOS and Linux, the Formal Endpoint recognizes 22 AI agents and coding tools, including Claude Code, Cursor, Codex and Devin, by the process that opens each connection. macOS uses code-signed process identity; Linux matches process names, which is less precise.

  • Network rules select traffic from a known agent and anything it spawns, such as git and ssh
  • On macOS, block an agent’s push to a sensitive repository while the engineer’s own push goes through
  • Find MCP servers and Claude Code skills nobody approved, then allow and monitor or block them (shadow AI detection)
AI coding agent security ›
endpoint · leo-mbpexample
10:14:02leo · terminalgit push acme/paymentsALLOWED
10:16:40claude-code for leogit push acme/paymentsBLOCKED
10:21:09cursor for leoMCP server not in the CatalogREVIEW
Cloud sandboxes

Keep keys out of the sandbox

The Endpoint runs inside Cursor Cloud Agents and Devin, in E2B, Daytona and Modal sandboxes, and as a sidecar in Kubernetes Pods and Amazon ECS tasks. Cursor and Devin runs sign in with the platform’s short-lived OIDC token, so each request names the engineer who started the run.

Sandbox for AI agents ›
endpoint · cursor-cloud-agentexample
run startcursor-agent for mayaOIDC token exchanged for a machine sessionALLOWED
run +2mcursor-agent for mayaPOST api.openai.com/v1/responsesTOKEN INJECTED
run +9mcursor-agent for mayamergePullRequest acme/api#412BLOCKED
MCP tool path

Route MCP servers through a gateway

MCP clients reach remote MCP servers through a Connector instead of connecting to them directly. The Connector adds the upstream credential, applies policy to each tool call and logs it.

  • Per-user OAuth to the upstream server, or a shared credential you choose
  • 80+ MCP server templates in the Catalog, plus your own remote HTTPS servers
  • Remote servers only: local stdio servers don’t go through the gateway
MCP gateway ›
connector · mcpexample
claude for anatools/call github.search_codeALLOWED
claude for anaupstream OAuth token for anaTOKEN INJECTED
cursor for leotools/call github.delete_repositoryBLOCKED
Identity

Give every agent an identity tied to a person

Agents sign in as machine users with short-lived OIDC tokens, from 15 built-in issuers or any OIDC provider. A session can carry the end user the agent acts for, so policies and logs see both.

  • Built-in issuers include Cursor, Devin, E2B, Modal, GitHub Actions and EKS
  • Devin’s database access is blocked by default; the engineer who asked approves in Slack, and the exception covers that Devin session only
  • The Access Graph shows which people and agents actually reached each resource
Non-human identity management ›
slack · #prod-accessexample
FormalAPP
devin for sam requests read access after a blocked query
Resource
prod-postgres
Query
SELECT id, status FROM orders
Scope
this Devin session
Duration
1 hour
sam approved for this Devin session, for 1 hour. The query went through.
APPROVED

AI agent security best practices

How to secure AI agents

Securing AI agents comes down to seven controls: an identity per agent tied to a person, no stored keys in agent environments, separate rules for agent and human traffic, an allowlist of MCP servers and tools, blocks on high-impact actions an agent shouldn’t take alone, just-in-time production access, and a log of every request with the agent and the person. Most of them have to run outside the agent. These are the ones we’d put in place first, in this order, with where Formal enforces each one.

  1. An identity per agent, tied to a person

    A shared service account hides which agent did what and for whom. Formal signs agents in as machine users with short-lived OIDC tokens and attributes each session to its end user.

  2. No stored keys in agent environments

    Replace them with an OIDC sign-in, or let the Connector inject the credential so the agent never holds it. Passthrough credentials don’t give you that: the agent still has the secret.

  3. Separate rules for agent and human traffic

    A rule that can’t separate the two either blocks the engineer or lets the agent through. The Endpoint does it by process identity, as described above.

  4. An allowlist of MCP servers and tools

    Approve servers in the Catalog, route remote servers through the MCP gateway, and set Guardrails to block, or allow and monitor, the servers and skills nobody approved.

  5. Blocks on high-impact actions

    A push to a protected repository, a merge of its own pull request, a write to a production database: an agent shouldn’t take these on its own, and the same actions stay open to people. On the Endpoint that’s a network rule plus a policy; on the Connector, a policy on the query.

  6. Just-in-time production access

    Grant production access just in time. Deny the agent by default, so it keeps least privilege between tasks, and let the person who owns it approve one time-bound exception in Slack. The JIT access guide explains the model.

  7. A log of every request, with the agent and the person

    Formal logs each request with its identity and sends logs to S3, GCS, Pub/Sub, Azure Blob, Datadog, Splunk or Panther.

What these controls don’t stop: None of these stop a prompt injection from reaching the model. They limit what an injected instruction can do once the agent acts on it. For LLM traffic, Insights flags prompt injection and the other OWASP LLM Top 10 risks in your logs after the fact; it doesn’t block them.

Coverage

Which AI agents and sandboxes does Formal cover?

On laptops, the Endpoint recognizes 22 AI agents and coding tools by name. In the cloud, it runs inside agent platforms and sandboxes, and agents sign in from 15 built-in OIDC issuers or any OIDC provider.

Known agent identities ›

Platform

The AI agent security platform behind it

Endpoint

Formal Endpoint

The forward proxy on laptops, VMs and agent sandboxes, and a sidecar in Kubernetes and ECS. It recognizes the agent behind each connection and applies policy before traffic leaves.

Connector

Formal Connector

The reverse proxy in your network, in front of databases, Kubernetes, APIs and MCP servers. It holds the credentials, decides on each query and tool call, and logs it.

Catalog

Formal Catalog

The MCP servers and skills your organization approves, 80+ server templates, and the Guardrails for anything nobody approved.

Workflows

Formal Workflows

Slack approvals that open a time-bound exception for one person or one agent session, and close it when it expires.

Customer proof

Technologies secured
10+
Resources secured
1,000+
Logs per week
40M+
Sessions per week
600K+
“Without Formal, we couldn't have agents with access to sensitive data. With Formal, because we are able to inspect all traffic and enforce controls, we are able to provide a safe environment for the agents to get the job done.”
Travis McPeak
Travis McPeak
Head of Security, Cursor
Read the Cursor story ›

FAQ

Questions about AI agent security

What is AI agent security?

AI agent security covers the identity, access, egress and audit controls for software that acts on its own: coding agents on laptops, cloud agents in sandboxes, and the MCP tools they call. LLM security is narrower and looks at prompts and model output. The risks themselves, from prompt injection to tool misuse, are covered in our agentic AI security guide.

Is it safe to give an AI agent access to production?

It can be, when the agent signs in with its own short-lived identity, never holds the production credential, and is blocked by default until a person approves a time-bound exception. Cursor gives agents access to sensitive data through Formal, with every request inspected (case study).

How is AI agent security different from an AI gateway?

An AI gateway sits between applications and LLM providers and sees prompts and responses. It doesn’t see the agent’s git push, its Postgres query or a call to an MCP server. Securing AI agents needs both. Formal’s AI gateway handles LLM traffic, and the Endpoint and Connector handle the rest.

Does Formal replace the agent's own sandbox or permission settings?

No. Keep the agent’s sandbox, permission prompts and hooks. As an AI agent security platform, Formal adds enforcement on the network path and at the proxy, so the controls don’t depend on how each agent is configured. We compared the two layers in network controls vs hooks.

Which AI agents does Formal recognize?

The Endpoint recognizes 22 AI agents and coding tools by name, including Claude Code, Cursor, Codex, Devin, GitHub Copilot CLI, Gemini CLI, Windsurf and Amazon Q. Agent rules only match known agents, so traffic from a tool that isn’t on the list is handled like any other process.

What should AI agent security tools cover?

AI agent security tools need a check at each place an agent acts: on the machine it runs on, on the path to the MCP servers it calls, and in front of the databases and APIs it reaches. AI agent security solutions that sit at only one of those points, such as an LLM gateway or a hook inside the agent, leave the other two open.

Does the Endpoint control agents on Windows?

Not yet. The Endpoint is generally available on Windows, but Transparent Mode and network rules are macOS and Linux only. On Windows, agent rules and egress inspection don’t apply yet.

Is Formal a non-human identity inventory?

No. Formal isn’t a non-human identity inventory or posture tool. The Access Graph shows the traffic it has seen; it doesn’t list the permissions an identity holds.

Put one agent behind a policy

Start with one coding agent or one cloud agent run, and see which hosts it reaches, which keys it holds and which actions it takes.