Skip to article
AI Agents

AI Agent Security

Classify trusted agents, malicious bots, and unknown automation using identity, authorization, intent, and behavior.

What is AI agent security?#

AI agent security controls how autonomous software receives access, uses tools, handles data, and acts on an online service. It also protects the agent itself from prompt injection, goal hijacking, excessive permissions, data exposure, and other failures that can redirect its behavior.

Service operators need a policy that assesses automation alongside the trustworthiness of the current agent, action, and context. An AI agent can plan across several steps and adjust when a page or workflow changes. A classic bot may follow a fixed script. Either can be useful or harmful, so the AI label alone does not determine risk.

A practical policy asks four questions:

  1. What evidence identifies the agent or the party operating it?
  2. Which actions has that party authorized?
  3. Does observed behavior match the stated purpose and normal journey?
  4. What is the impact if the requested action is wrong or abusive?

Why good-or-bad classification is not enough#

A binary label hides uncertainty. An agent may identify itself but lack permission for a specific account. Another may look automated without providing enough evidence to establish its purpose. An approved integration may also change behavior after a software update, stolen credential, or malicious instruction.

Trust is therefore a scoped decision, not a permanent property of a product or agent name. It can apply to one identity, session, journey, and set of actions. Preparing for AI Agents explains why intent and context matter when useful and harmful automation can use similar interaction patterns.

AI agent classification needs a third state for insufficient or conflicting evidence. That state lets a service limit risk without treating every new form of automation as malicious.

Three classes for automated traffic#

Trusted AI agents

Trusted AI agents present enough evidence for a defined action. That evidence can include an approved integration, valid scoped credentials, user consent, a recognized operating pattern, and behavior that remains inside policy.

The word trusted does not mean unrestricted. A trusted shopping agent may search a catalog but still require fresh authorization before checkout. Trust should expire, narrow when risk rises, and be revoked when behavior changes.

Unknown automation

Unknown automation shows signs of automated control but lacks enough evidence for an allow or deny decision. The identity may be new, incomplete, inconsistent, or unrelated to the requested action. Behavior may also be unusual without proving abuse.

Unknown does not mean malicious. The default response should preserve low-risk access while limiting sensitive actions. A service can observe, rate-limit, request verification, or require stronger authorization until more evidence is available.

Malicious bots and agents

Malicious automation shows evidence of prohibited intent or action. Examples include credential attacks, unauthorized account changes, payment abuse, data extraction outside policy, attempts to evade controls, and repeated activity after access is revoked.

Classification should follow the evidence, whether the automation uses an AI model or a fixed script. The response can block the action, terminate the session, revoke credentials, preserve investigation data, and alert the responsible security team.

Class Minimum evidence Default policy
Trusted Verified relationship, scoped authorization, and behavior within policy Allow approved actions; log and reassess
Unknown Automation indicators with incomplete or conflicting trust evidence Limit, observe, rate-limit, or verify
Malicious Evidence of prohibited intent, unauthorized action, or control evasion Block, revoke, investigate, and alert

Signals for AI agent classification#

Agent trust management combines several evidence groups. The OWASP AI Agent Security Cheat Sheet provides additional guidance for securing agent identity, permissions, tools, memory, and output. No single signal should grant permanent trust.

  • Identity: credentials, signed requests, integration records, account relationships, and declared agent information.
  • Authorization: token scope, user consent, resource ownership, allowed tools, and whether approval is current.
  • Behavior: action sequence, velocity, retries, navigation pattern, tool use, and deviation from an established baseline.
  • Journey context: whether the agent is reading public content, changing an account, exporting data, or initiating a payment.
  • History: prior policy compliance, failed verification, credential rotation, revocation, and earlier class changes.

Self-identification is useful evidence but cannot establish safe intent. Likewise, human-like cursor movement cannot establish that a request is human or authorized. The classification should reflect the combined evidence and the risk of the current action.

hCaptcha Enterprise can detect and identify many popular AI agents, then apply rules to specific agents or to all agent traffic. Detection supplies an identity signal; the requested action and its context should still determine the response.

How to build an agent-classification policy#

1. Inventory actions by impact

List the journeys an agent can reach. Separate read-only public actions from account changes, data access, purchases, messages, and irreversible operations. Define who can authorize each action and how long that authorization remains valid.

2. Set evidence requirements

Document the minimum identity, authorization, and behavior evidence for each class. High-impact actions should require stronger and fresher evidence than public browsing. OWASP recommends least-privilege tool access and explicit authorization for sensitive operations when securing agents.

3. Map each class to controls

Choose a response for every class and journey. A trusted agent can receive scoped access. Unknown automation can continue through low-risk paths with limits or verification. Malicious activity should lose access before it can repeat the action.

4. Reclassify during the session

Evaluate important actions as they occur. An agent can move from unknown to trusted after verification, or from trusted to malicious after credential misuse or a prohibited action. Reclassification prevents an early allow decision from becoming permanent access.

5. Log decisions and outcomes

Record the evidence, policy version, classification, response, and result for security-relevant actions. Review false positives, missed abuse, time spent in the unknown class, verification outcomes, and class changes. These measures show whether the policy protects sensitive journeys without blocking acceptable automation.

Frequently asked questions#

What is the main goal of AI agent security?

AI agent security limits what autonomous software can do and protects services from unauthorized or harmful agent behavior. It combines identity, authorization, behavior, action risk, and independent evidence of agent behavior.

How does a service classify a trusted AI agent?

A service should require evidence of an approved relationship, scoped authorization, and behavior that matches the permitted purpose. The trusted classification should apply only to defined actions and should be reviewed as the session changes.

Is unknown automation malicious?

No. Unknown automation means the available evidence is not sufficient for a trusted or malicious decision. A service can limit sensitive actions, gather more evidence, or request verification without blocking all access.

How is AI agent security different from bot management?

Bot management classifies and responds to automated traffic broadly. AI agent security adds controls for delegated authority, multi-step planning, tool use, memory, and agent-specific risks, while still using many bot-management signals and responses.

Which signals support AI agent classification?

Useful signals include agent identity, credentials, authorization scope, user consent, behavior, journey context, action impact, and prior policy history. A decision based on several signals is more reliable than a permanent allowlist or one behavioral clue.

Sources and references

  1. Preparing for AI Agents hCaptcha
  2. AI Agent Security Cheat Sheet OWASP Foundation
  3. Detecting AI Agents hCaptcha Docs