Agentic AI for the Enterprise: security and safety

Agentic AI for the Enterprise: security and safety

Agentic AI has a lot of potential, and getting from an idea to a proof of concept is generally fast. The step from proof of concept to production rollout is the harder one, because that is where security and safety have to be settled.

Series: Agentic AI (3 articles)

  1. 3
    Agentic AI for the Enterprise: security and safety This article
Disclosure: written by Purnaresa Y, Security Solutions Architect at AWS, assisted by Claude Opus 5.
Safety means knowing whether you can trust the output enough to make a business decision on it. Security means building layered control so the AI cannot be put to unintended use. By the end you have a short list of things to settle before your own agent goes live.

Cross the gap between the PoC demo and production

A proof of concept only has to work once. It runs for a friendly user, on an example someone picked, and the person presenting it knows which questions to ask. Production changes all three, because the inputs are not chosen, some of the users are not friendly, and a decision made on a bad answer stays made. Closing that gap means answering two questions, one about safety and one about security.
Safety comes first here because output nobody can trust is not worth protecting. Once it is worth trusting, that trust becomes the thing to defend. An agent that takes action holds real permissions, and an attacker who reaches the agent reaches those permissions.
The two definitions in the summary are mine, because no standard separates the words this way. Other writing uses safety more broadly, covering harmful and biased content, so the narrower meaning here is deliberate.

Know whether you can trust the output

See how a wrong answer gets through

An airline's website chatbot told a customer he could claim a refund after travelling. The airline's real policy, published on the same website, required the request first. The refund was refused. The customer took the airline to a small claims tribunal in Canada, and it ruled that the airline was responsible for what its own tool had said. [1][2]
Nothing caught the answer, because it was fluent, correctly formatted, and carried nothing a content filter looks for. The policy did not exist.
Three checks on that one answer:
Check
Result on the airline's answer
Is the answer factually accurate
fails, the policy did not exist
Is the answer supported by the sources the agent was given
fails, the airline's own website said otherwise
Does the answer contain harmful content
passes, nothing in it is harmful
The case is often called a hallucination. The technology was never made public, and the tribunal ruled only on negligence. [2]

Check the output before anyone acts on it

Evaluation runs between the agent and the user. Published practice gives a workable starting set of three metrics. [3]
  • Correctness "evaluates whether the information in the agent's response is factually accurate". [3] To run it you need to know the right answer, which means a set of questions with approved answers attached. Building that set is the same work as writing test cases.
  • Faithfulness "evaluates whether information in the response is supported by provided context/sources", or in the research wording, the answer is "grounded in the given context". [3][4] To run it you need the context the agent retrieved, so the check can compare the answer against it.
  • Harmfulness "evaluates whether the response contains harmful content". [3] To run it you need your own statement of what harmful means in your business, because the word means different things in a bank and in a hospital.
Correctness and faithfulness are two different checks. An answer can be faithful to a document that is out of date. It is supported by everything the agent was given and still wrong about the world. Measuring faithfulness alone passes that answer.

Each check produces a score. A score on its own says nothing about what to do with the answer, so you set the threshold and decide what happens under it. The options are the ones you use on other quality gates: block the answer, send it to a person, or let it through with a warning attached. Decide that before launch, or the scores become a dashboard nobody acts on.

Protect that trust with layered control

Evaluation checks the answer. Both failures in this section happen at the action, so a good answer is no defence against either one. Two questions tell them apart. Did the agent do something it should never have been asked to do? Did it do something it should never have been able to do? The same visible damage can come from either, and the difference is which control would have prevented it.
Both failures come from a list of ten that publishes no ranking. [5] The selection is mine, and these two are here because they point at the two different controls. The full list is worth reading, and it also covers the supply chain, communication between agents, and one failure cascading into many. [5]

Control who can instruct the agent

The first failure is an agent that accepted instructions from someone who should not be giving them. Every permission it used was one it legitimately held, so tighter permissions would not have stopped it. An outsider gets the agent to hand over data it is allowed to read, or to carry out an action they could not carry out themselves. The agent is working exactly as it was built to, for the wrong person and the wrong purpose. This failure splits into two entries in the taxonomy. Goal hijack is the attacker changing what the agent is trying to do. [5] Privilege abuse is the attacker using the access the agent already holds. [5] One changes the intent and the other borrows the access.
Five controls govern what reaches the agent and what identity it carries. [5]
  • Untrusted input handling. Treat every natural language input as untrusted before it can influence the goal, whether it comes from a person, a document, a web page, or another system.
  • Locked instructions with drift alerting. Keep the agent's own instructions out of reach of the conversation, and alert when the goal it is working towards moves away from the one it was given.
  • Task scoped credentials that expire. Scope permissions to the task and to a time window, so a stolen session buys little access for a short time.
  • Session isolation. Keep sessions separate and clear state between tasks, so one conversation cannot reach into another.
  • Authorization for each action. Check authorization at every action instead of once at the start, and put a person in the loop before any privilege increases.

Narrow what the agent is able to do

The second failure is an agent that could do more than its task needed. Nobody attacked anything. The agent was given a task and a tool. It used that tool further than intended, deleting a file nobody meant it to touch. It is the more common of the two failures, because it needs no attacker. All it needs is an instruction that was more open than the person writing it realised. The published taxonomy calls this tool misuse, and its own description names "misalignment, or unsafe delegation or ambiguous instruction" alongside deliberate attacks. [5] When the agent writes and runs its own code, a small scope error becomes an arbitrary one, which the taxonomy treats separately as unexpected code execution. [5]
Four controls limit what an action can do. [5]
  • Least privilege for each tool. Give every tool the narrowest permission that still lets it work, and cap how often it runs and what it can reach. An agent that can only read one folder cannot delete another one.
  • Approval on anything hard to undo. Require a person to approve actions that cannot be reversed, and show the change before it is applied, so the approver sees it instead of a description of it.
  • Sandboxed execution. Run the agent in an isolated environment, with restricted filesystem access and never with administrative rights.
  • Preview separated from effect. Make sure that looking at something never changes it.
Both groups of controls are needed, because each one stops a different failure. Doing one group and stopping leaves the other failure open.

Parts of most workflows do not need AI at all. A step that runs as ordinary code cannot be talked into anything, and leaving those steps alone costs nothing.

Takeaway

  1. The gap between a demo and production is where safety and security get settled, because production takes inputs you did not choose and users who are not all friendly.
  1. Settle safety first. Check the output before anyone acts on it, using correctness, faithfulness, and harmfulness together, because each one looks at something different.
  1. Then protect that trust. On any incident, ask whether the agent did something it should never have been asked to do, or something it should never have been able to do.
  1. The first question points at who can instruct the agent and the second at its permissions. Answer both, because each one stops a different failure.
Getting to a proof of concept is fast. Getting to production means settling both questions, in that order, because trust comes first and the controls exist to keep it.

References

[1] Moffatt v. Air Canada, 2024 BCCRT 149, British Columbia Civil Resolution Tribunal.
[2] Brand, J. L. M., "Air Canada's chatbot illustrates persistent agency and responsibility gap problems for AI", AI & Society, volume 40, pages 3361 to 3363, 2025.
[3] Amazon Bedrock AgentCore FAQs, "What metrics does AgentCore Evaluations track?".  https://aws.amazon.com/bedrock/agentcore/faqs/ 
[4] Es, S., James, J., Espinosa-Anke, L., Schockaert, S., "Ragas: Automated Evaluation of Retrieval Augmented Generation", arXiv:2309.15217.  https://arxiv.org/abs/2309.15217 
[5] OWASP Top 10 for Agentic Applications 2026, OWASP GenAI Security Project, version 2026, December 2025.  https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026/ 

Series: Agentic AI (3 articles)

  1. 3
    Agentic AI for the Enterprise: security and safety This article
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article