Articles

Securing AI agents: when your assistant has access to your systems

Follow a triage assistant through scoped tools, action approvals, and the OWASP LLM Top 10. Change its permissions and see what gets through.

AI agentsLeast privilegeOWASP
In this article

"It only drafts a summary" sounds reassuring until the same assistant can search every incident, email the results, and run commands in production.

The summary is the task. Those other capabilities are decisions someone made while connecting the tools. They deserve their own security review.

Consider a fictional security operations team adding an assistant to incident triage. An analyst selects a case; the assistant gathers related events and prepares a draft. That is useful work. The interesting part is deciding what happens when a case description contains a hostile instruction, the assistant draws the wrong conclusion, or a connector returns more data than it should.

I would review that assistant much as I would review a service account with a new workflow: identify its job, inspect its grants, and follow each path by which data leaves or systems change. The model adds uncertainty to the plan. It does not remove the need for ordinary access control.

Define the job before choosing the tools

"Help the SOC" is a product ambition. It is too broad to be a permission policy. "Prepare a draft for the selected case using records the assigned analyst may read" gives the implementation something it can check.

Task
Draft a summary of case 4172.
Read scope
The case and its linked events, subject to the analyst's access.
Output
A draft in the current case workspace, with evidence links.
Escalation
An analyst decides whether to close the case or take a response action.

This scope should affect the actual identity used for tool calls. A case-bound grant is more useful than a prompt telling an organization-wide administrator to be careful. Where possible, use short-lived credentials, bind them to the current user and task, and have the backend reject resources outside that grant.

Splitting a connector into narrow operations helps. A tool that reads approved fields from one case is easier to reason about than a generic HTTP client with a bearer token. Tool descriptions explain intended behavior to the model; server-side checks must enforce the permission.

OWASP's excessive-agency guidance recommends scoping tools and resources to the task. For this assistant, the practical question is simple: which required step needs access to every incident? If there is no such step, that grant has no job here.

Put authorization outside the model

A model can propose reading a case. A trusted service decides whether this user, in this task, may read that case. Keeping those decisions separate means a convincing document cannot simply talk the application into issuing a broader token.

  1. User taskSets the case and intended result.
  2. Model proposesSuggests a typed tool operation.
  3. Policy checksVerifies identity, scope, arguments, and any approval.
  4. Tool executesUses a constrained identity; records the outcome.
Read left to right. The policy service checks each proposed operation before the tool executes it. Model output cannot edit the policy.

For a case-read request, validate the operation's shape, resolve the record, check the tenant and analyst's access, then check the narrower task grant. A valid case ID is not enough. The same operation can be syntactically correct and forbidden for this job.

Also follow the result out of the tool. If a case lookup includes an unrelated attachment, credential, or another tenant's fields, the model may already have seen data it should never receive. Apply restrictions before retrieval and return only the fields the task needs.

A second model can review a proposed action, but it should not be able to grant permissions the backend denies. Its value is another chance to catch a mistake, with a clearly defined failure mode. The access-control service remains responsible for enforcement.

Try the same task with different grants

Suppose an incident description tells the assistant to fetch another case, forward notes outside the organization, and run a production command. The task has not changed. The available damage depends partly on what the application permits.

Same task. Different permissions.

The job is to draft a summary of case 4172. Change the grants and inspect which requests the tool layer would accept.

Agent permissions
Allowed

Read case 4172 and draft its summary

This is the assigned case. A draft stays in the current workspace.

Blocked

Fetch unrelated case 9001

The case ID falls outside this task's read grant.

Blocked

Email the case notes to an outside address

The agent has no outbound email permission.

Blocked

Run a shell command against production

The agent has no production shell capability.

A simplified policy model, not an attack simulation or security score. Blocking an action does not prove the generated summary is accurate or safe.

The legitimate draft stays possible under the narrow grant. That is the point of least privilege: remove capabilities the workflow does not need while preserving the useful work.

Read-only access deserves care too. An assistant that can read every investigation and send arbitrary network requests has a route for disclosure without changing a single database row. Even an apparently harmless URL can carry data in its query string. Check destinations and data movement across the whole tool set.

Make approval mean something

A button labelled "Allow the assistant to continue" leaves an analyst guessing. Before a consequential action, the review should show the resolved operation: which resource changes, which recipient receives data, and what exact content leaves.

For example, if the workflow later supports email, a useful review might look like this:

Open an example action review

This is a static example of what an analyst should be able to inspect before an application asks for approval.

Operation
Send a case summary by email
Recipient
soc-lead@company.example
Subject
Case 4172: triage draft for review
Body
Three failed logins were recorded for host WS-17. The supplied events do not establish a successful login. Please review the linked evidence before deciding on containment.
Attachments
None
Approval scope
This exact message and recipient, once, within a short expiry window.

The application should bind approval to that action and recheck it at execution. If the assistant changes the recipient or adds an attachment, the old approval no longer applies. Time limits and one-time use help prevent an old decision being replayed in a new context.

There is a human limit here as well. Asking an analyst to approve every harmless read creates noise, and noise encourages automatic clicking. Reserve review for actions with meaningful consequences, and make the permitted low-risk path narrow enough to run without constant interruption.

The OWASP Top 10, applied to this assistant

The OWASP Top 10 for LLM Applications, 2025 edition is a useful way to find gaps beyond prompt injection. The edition matters because names and numbering can change. These ten entries use the published 2025 list; the case examples and suggested controls below are my application of it to this workflow.

Open a risk to see how it could appear in the triage assistant.

LLM01Prompt Injection

An attacker-controlled incident description tells the assistant to close the case and suppress the warning. The case text is trying to become an instruction.

Keep source content distinct from the user's task and enforce case-state changes at the tool boundary. Test instructions planted in retrieved records as well as chat messages.

Read OWASP's LLM01:2025 entry
LLM02Sensitive Information Disclosure

The assistant includes an access token from a log excerpt in the incident summary. Nothing needs to be sent to an outside address for that disclosure to matter.

Minimize retrieved fields, redact secrets before they enter context, and restrict who can view the resulting draft. Apply the same care to traces and debug logs.

Read OWASP's LLM02:2025 entry
LLM03Supply Chain

A compromised tool package or connector update changes what the assistant can read or where it sends requests.

Track the provenance and versions of models, tool servers, dependencies, and datasets. Review permission changes when integrations are updated; familiar names do not establish integrity.

Read OWASP's LLM03:2025 entry
LLM04Data and Model Poisoning

Contaminated training or fine-tuning data teaches the system that a particular malicious pattern is harmless. Poisoned retrieval content can also steer its response.

Record where data came from and who could change it. Separate approved reference material from unreviewed contributions, and evaluate behavior after dataset or model changes.

Read OWASP's LLM04:2025 entry
LLM05Improper Output Handling

The model produces a shell command as a suggested response, and the application executes it. Or a report renders model-generated markup as trusted HTML.

Treat generated output as untrusted. Use safe rendering, validate tool arguments, and independently authorize execution. Well-formed JSON can still describe an unauthorized action.

Read OWASP's LLM05:2025 entry
LLM06Excessive Agency

A triage assistant receives production administrator access because it might occasionally be useful. A mistaken plan can now change live infrastructure.

Limit the available operations, the resources each operation reaches, and which actions require review. A case-summary task should not carry an unrestricted shell.

Read OWASP's LLM06:2025 entry
LLM07System Prompt Leakage

A user extracts internal prompt text and discovers an embedded credential or a business rule the team assumed was secret.

Keep secrets out of prompts. Enforce access rules in the application so disclosure of the prompt cannot grant access. Prompt confidentiality is not an authorization mechanism.

Read OWASP's LLM07:2025 entry
LLM08Vector and Embedding Weaknesses

The retrieval service returns a similar incident from another tenant. The assistant has already received confidential material before it writes an answer.

Apply tenant and record-level access checks during retrieval. Test isolation with deliberately similar documents across tenants. Similarity is a relevance signal, not a permission check.

Read OWASP's LLM08:2025 entry
LLM09Misinformation

The assistant confidently names a host as compromised even though the evidence only shows a failed login. A plausible narrative outruns the records.

Link claims to inspectable evidence, preserve uncertainty, and require analyst review for consequential decisions. Check that citations support the claim; a citation alone does not prove it.

Read OWASP's LLM09:2025 entry
LLM10Unbounded Consumption

The agent keeps searching for one more corroborating event, generating more tool calls and model usage without reaching a stopping condition.

Set task-level limits for elapsed time, tokens, tool calls, and spend. Enforce them outside the model and report an incomplete task when a limit is reached.

Read OWASP's LLM10:2025 entry

Several categories can describe parts of the same incident. A poisoned document might carry a prompt injection, which steers an overpowered tool into disclosing information. Counting category labels tells you less than tracing that path and deciding where the application will stop it.

Keep evidence and a way to stop

If an agent makes a bad call, "the AI did it" is an expensive place to begin an investigation. Keep enough metadata to reconstruct the action: task and user IDs, source record IDs, tool and model versions, requested operation, policy decision, approval reference, and execution result.

Keep credentials and unnecessary sensitive content out of those traces. Access to the logs needs its own restrictions. You need evidence that an operation was allowed or denied; you do not need a second copy of every secret the workflow encountered. OWASP's agent guidance covers monitoring, data protection, and validation.

Memory is another store to review. A hostile case description saved as a helpful "preference" can outlive the case. Separate memory by user and tenant, retain its source, and decide which kinds of information the application may persist. Retrieved text should not silently rewrite the agent's operating policy.

Before rollout, I would test a few concrete failures:

  • A request for another tenant's case fails before its contents reach the model.
  • An injected instruction cannot add a tool or expand the current task's grant.
  • A changed recipient, payload, or attachment invalidates the earlier approval.
  • A connector timeout or repeated search loop reaches a task budget and stops with a visible incomplete result.
  • Revoking the task credential prevents subsequent calls from that run.

Those tests establish specific behaviors under a recorded setup. I would also test normal cases, inspect the summaries for unsupported claims, and repeat the evaluation when the model or connectors change. Successful authorization checks cannot tell you whether the assistant understood the evidence.

My first rollout would draft in a restricted workspace, with an analyst reviewing the result. I would add state-changing operations only after the team could explain their permissions, approval path, failure behavior, and revocation mechanism. A useful assistant can start with a small job. Expanding its access is a product decision that should leave a reviewable record.

Sources and further reading

The scenarios and interactive examples are constructed for this article. These sources support the technical discussion.

  1. OWASP Top 10 for LLM Applications: 2025 edition

    The exact risk names and numbering used in the expandable reference above.

  2. OWASP: AI Agent Security Cheat Sheet

    Tool scoping, independent authorization, action integrity, memory, monitoring, and testing.

  3. OWASP: LLM Prompt Injection Prevention Cheat Sheet

    Untrusted external content, tool-call restrictions, and the limits of model-based screening.