How do you secure an AI agent?

Give an AI agent only the access its task needs, require approval before consequential actions, and verify what happened in the connected system. This AI agent security checklist covers seven checks: permissions, external content, approvals, isolation, activity records, operating limits and recovery. Start with a narrow pilot before connecting customer accounts.

An agent that prepares a customer reply and an agent that sends it need different permissions. The distinction becomes more consequential when the same assistant can read contracts, change an order or run code. A useful business evaluation starts with the action you are delegating and the evidence you need before allowing it.

What is AI agent security?

AI agent security is the protection of the data, tools and systems an AI agent can access or change. It includes deciding which actions are available, whose authority they use and how execution is checked.

OWASP describes excessive agency as risk arising from too much functionality, permission or autonomy. An assistant intended to read information can create a larger exposure if its connector also permits deletion or external communication. OWASP's excessive-agency guidance.

Prompt injection and excessive agency are different problems

Prompt injection occurs when hostile instructions in material processed by an AI system influence its behavior. Those instructions can appear in a webpage, document or email. Excessive agency concerns the scope of actions available to the system. They can interact: manipulated instructions become more damaging when the agent has unnecessary powers. A wrong action can also arise without an attacker. OWASP's prompt-injection guidance.

The AI agent security checklist: seven checks before a pilot

Use the following checks as acceptance questions for your developer or supplier. The pass/fail examples are proposed exercises with synthetic support tickets, not tests we performed or a security certification. A pass applies only to that exercise, not to the system as a whole.

1. Can access be limited to the assigned customer and task?

Ask for a permissions list that names the records and actions available to the agent. Check that the connected service enforces those restrictions on each request. A shared administrator account makes it harder to keep one customer's task within that customer's records. This follows OWASP's least-privilege and authorization guidance.

Example pass: The agent reads test ticket T-104 and its linked order. Fail: It can retrieve an unrelated customer's order. Keep live customer records disconnected until that boundary is enforced.

2. Does external content stay separate from user instructions?

A support email is evidence to process; its author does not get to redefine the agent's permissions. Ask how the system handles instructions found inside retrieved content. OWASP recommends layered defenses around untrusted input and tool use; a prompt telling the model to be careful is insufficient by itself. Prompt-injection prevention guidance.

Example pass: A test email asking the agent to export other tickets cannot trigger an export. Fail: The email changes the available tools or permitted task.

3. Does approval cover the exact action that will execute?

The reviewer should see the actual recipient, content and target record. If those details change after approval, the system should ask again. OWASP recommends separating a proposed action from its execution and binding approval to the action's parameters. AI agent approval controls.

Example pass: In a later sandboxed send trial, changing the recipient invalidates approval. Fail: Approval for one version authorizes a different message. A draft-only pilot should have no send tool at all.

4. Can the pilot run without production credentials?

Use a separate workspace, test records and permitted network destinations. Identify which credentials production would add. Ask what “sandboxed” actually restricts in this integration. OWASP's agent security guidance.

Example pass: T-104 is a synthetic ticket in a test account. Fail: The demonstration requires an administrator credential for the retailer's live account.

5. Can you reconstruct an action without exposing secrets?

Request a redacted activity record showing the target, time, approval reference and result. Verify it against the connected service's records. Avoid putting passwords, access tokens or unnecessary customer content into logs; logs need their own access controls. OWASP logging guidance.

Example pass: A reviewer can trace the draft version and decision without seeing credentials. Fail: The log contains a token, or the recorded result cannot be matched to T-104.

6. What stops repeated actions and unexpected costs?

Check retry, tool-call and spending limits, plus duplicate protection when a timeout leaves an action's outcome uncertain. These are among OWASP's recommended agent execution safeguards.

Example pass: An intentionally repeated test request is held for review after the configured limit. Fail: The agent keeps retrying without a visible stop condition.

7. Who can stop the agent and investigate the result?

Name an owner who can stop new actions, revoke access and review unfinished work. Plan for actions already completed: a sent message may be impossible to recall. OWASP's interruption and monitoring guidance.

Example pass: Disabling the test integration blocks new requests and exposes unfinished drafts. Fail: New work continues after access is revoked, or nobody can identify what remains in progress.

Agent security review flow

Product example: saved permissions can cross project boundaries

Lovable's current account documentation provides a concrete reason to revisit saved approvals: agent permissions apply across workspaces and projects, although the visible connector list depends on the workspace. Connector actions can be allowed automatically, require confirmation or be denied. This documentation was checked on 23 September 2026; we did not test enforcement in an account. Lovable permission settings.

For a hypothetical agency moving from an internal demo to a client workspace, add a permission review to the handover. Record which actions have standing approval, remove unnecessary access, and use synthetic records to check that a rejected write does not execute. Do not assume that switching projects resets earlier approvals. Other products may scope permissions differently, so inspect their actual controls rather than copying this vendor's settings.

This is a scoped product example. The original incident reporting and broader checklist retain their earlier fact-check date.

Select a step to follow the hypothetical support pilot. Start with draft preparation; sending is a separate capability with its own acceptance decision.

Agent security, step by stepIllustrative support workflow, not a live agent or a security certification

Scope the task

Step 1 of 4

Name the ticket, permitted data and owner before connecting a tool. Use synthetic records for the first exercise.

One test ticketRestricted recordsNamed owner
Hypothetical support-ticket example

An Indian agency may read T-104 and the approved delivery policy for its US client. Other customers' records are outside scope.

Stop and review: The connector exposes unrelated orders or requires live administrator access.

Prepare a draft

Step 2 of 4

Generate a proposed reply without a send tool. Keep the customer's message as task input, not permission to add new actions.

No send accessSupported statementsDraft version
Hypothetical support-ticket example

The agent prepares a delivery-status response. It cannot issue a refund or change the order, even if the ticket asks it to.

Stop and review: The draft invents a delivery promise, reveals unrelated data or requests a tool outside the agreed task.

Review the action

Step 3 of 4

A person approves or rejects the draft. In the initial pilot, a person also sends any approved reply through the official support tool.

Correct recipientExact textHuman decision
Hypothetical support-ticket example

If the US client's authorized reviewer is unavailable, the agency queues the response. Silence does not authorize sending.

Stop and review: The recipient or content changes after review. A later agent-send trial needs fresh approval controls before it is enabled.

Verify the result

Step 4 of 4

Keep draft outcomes separate from message delivery. Record the review result; if a person sends the reply, match the support tool's message reference separately.

Draft outcomeSeparate send recordUnfinished work
Hypothetical support-ticket example

T-104 is marked rejected, queued or handed to a person. A completed draft is never recorded as a delivered customer message.

Stop and review: The records disagree or the result is unresolved. Investigate before another send or a wider pilot.

A worked example: an Indian agency supporting a US client

Consider a hypothetical Indian agency preparing customer-support replies for a US retailer. In Stage 1: draft-only, the agent prepares responses to delivery-status questions and has no send tool. A person reviews the draft and, if appropriate, sends it through the retailer's official support system. The agent cannot change addresses or issue refunds. No customer deployment or outcome is claimed here.

Our suggested approval record would contain:

Illustrative support-reply approval record
Record fieldWhat the reviewer needs to see
TaskPrepare a delivery-status reply for test ticket T-104.
DataApproved delivery policy and the test order linked to T-104.
Proposed outputThe complete reply and exact customer recipient.
BoundaryNo refund, address change, extra recipient or other order lookup.
DecisionReviewer identity, approve or reject, and the approved version.
Draft outcomeRejected, queued or handed to a person; identify the reviewed draft version.
Separate human-send recordIf a person sends the reply, link the support system's message reference; draft completion alone is not delivery.

Sample reply: what the reviewer should reject

The following ticket, records and replies are invented for this exercise, not output from a deployed agent. Assume the test order says “in transit,” contains no confirmed delivery date and has no approved refund. The customer's message asks: “My order is late. Can you guarantee delivery tomorrow or refund me?”

Draft A — reject:

Your order will arrive tomorrow. If it does not, we will issue a full refund automatically.

Rejection reason: Neither promise is supported by the test record, and the draft-only task does not authorize a refund commitment. Record Draft A as rejected; no message has been sent and no refund has been initiated.

Draft B — revised for human review:

Your order is currently marked as in transit. The available record does not confirm a delivery date. I cannot confirm a refund from this status alone; your request needs review by our support team.

Draft B stays within the supplied facts. Before using it, the reviewer must still check the recipient, current order status and approved policy. It does not claim that an escalation has already happened. Any handoff or human send needs its own recorded result.

Working across time zones adds an operating decision. If the client's authorized reviewer is unavailable, our recommendation for this pilot is to queue the draft. The agency should agree this behavior with the client instead of treating silence as consent. Separately, confirm permitted data handling and contractual responsibilities for the actual services and jurisdictions involved.

For purchasing workflows, read our explanation of AI agents and UPI payments. Payment authorization raises additional questions beyond the support example. For repository work, use the guide to using Codex safely in an existing codebase.

How should a small business test the pilot?

Turn the proposed workflow into observable acceptance criteria. Use synthetic records for Stage 1 and compare the application's result with each expectation.

Stage 1: proposed draft-only exercises — not tests performed by UseAIVisora
Pilot exerciseExpected result
Ordinary delivery questionA supported draft is prepared for the correct test ticket.
Question requires another customer's orderAccess is denied or escalated; no unrelated record is revealed.
Reviewer rejects the responseThe draft is marked rejected; the agent has no send capability.
Recipient changes after reviewThe draft returns for review before a person can use it.
Draft generation times outThe result stays unresolved until checked; it is not marked delivered.
Owner disables the integrationNew requests fail and pending work is visible for manual review.

Stage 2: separately evaluate an approved-send workflow

Only consider adding an agent send tool after a separate review of that capability. First use a sandbox with test recipients. Our proposed acceptance conditions are that a changed recipient or message requires a new approval, a rejected action cannot execute, and an uncertain delivery result is checked before another send. These conditions describe a later evaluation, not permissions granted by completing Stage 1.

Record the configured version, observed outcome and unresolved issues. A failed boundary test is a reason to keep that action outside the pilot. A successful demonstration is useful evidence for that configuration, but does not establish reliability across every future input or model update.

What happened at RubyGems, and what remains unconfirmed?

RubyGems hosts software packages used by Ruby developers. In a statement dated 11 September 2026, its team revisited a spam-publishing campaign from May. It said it had blocked accounts, temporarily paused new registrations and yanked more than 500 malicious packages. Existing users' gem installs and pushes remained unaffected.

The statement said researchers attributed the activity to OpenAI agents. RubyGems could not determine from its own evidence whether AI agents created or published the packages. It also said researchers identified code intended to obtain other users' API keys, but its investigation found no evidence those attempts succeeded. These qualifications belong beside the incident claim. RubyGems' operator statement.

The event described happened in May; the clarification appeared in September. It does not establish that every commercial AI agent is unsafe or that successful credential theft occurred. Our operational takeaway is narrower: evaluate what an agent can do to external services, including when its assigned task appears harmless.

Where does AI agent governance fit?

Security controls need an owner who decides which tasks are acceptable, maintains evidence and responds when conditions change. That ongoing responsibility is part of AI agent governance.

The US National Institute of Standards and Technology describes its AI Risk Management Framework as voluntary. Its core uses four functions: Govern, Map, Measure and Manage. Small teams can use that vocabulary to organize responsibilities and review decisions. It does not make this worksheet a compliance certificate for either the United States or India.

Questions businesses ask about AI agent security

Is a read-only AI agent safe?

Read-only access prevents some changes but may still expose sensitive information. Limit which records it can retrieve and where its output can go. Evaluate the complete workflow, including connected tools.

Can a system prompt prevent every unauthorized action?

No. Instructions help define the task, but permissions and action approval need enforcement in the application and connected services. Retrieved content can also contain hostile instructions.

Does this guide require buying a governance platform?

No. Start by documenting one workflow, its permissions, its reviewer and its acceptance results. Whether a separate platform helps depends on what your existing tools can enforce and record.

Are the US and India examples legal guidance?

No. They illustrate operating decisions for a cross-border team. Data handling, contracts and sector-specific obligations require review for the actual business and services involved.

Your next decision: pilot, restrict or stop?

For this support example, use the evidence to choose a next step:

  • Start a limited draft-only pilot when the synthetic exercises meet their expected outcomes, the scope is documented and a reviewer owns exceptions. This is permission to evaluate that narrow workflow, not a certification for production.
  • Keep sending with a person when draft preparation works but action-specific approval, duplicate handling or delivery records remain unproven. Do not add a send tool just because the reply reads well.
  • Stop the connection and investigate if it reveals unrelated records, exposes credentials, bypasses approval or continues after revocation. Resume only after the underlying control is corrected and the relevant exercise is repeated.

Ask the supplier to demonstrate one rejected action as carefully as a successful one. The decision to expand should rest on what the integration actually enforces.