AI agents in production: the guardrails to build before you open your systems

An AI agent stays reliable in production when its limits are built into the software itself: permissions, stop conditions, audit trail, kill switch, budget and fallback plan. Explore the seven design and governance questions to settle before you open your systems to it.
Artificial Intelligence
Spiria Team in collaboration with Gabriel Mongeon, Director of AI
2026-11-24
•
5 minute read

You have chosen a use case that meets the right conditions, set your agent’s level of autonomy, and the demo is delivering good results. Next comes the stage that calls for the most rigour, when the agent starts acting in your real systems, with real data and real clients. The question that matters then becomes what you allow it to do, and the answer comes down to seven design and governance questions, where the choices you make determine the risks you accept, the costs you need to control and the long-term reliability of your solution.

In this article

  1. Why isn’t an AI agent that works in a demo ready for production yet?
  2. How do you limit what an AI agent can do in your systems?
  3. How do you protect an AI agent from prompt injection and unexpected cases?
  4. How do you trace and audit an AI agent’s decisions?
  5. How do you stop an AI agent and keep its costs under control?
  6. How do you avoid depending on a single AI vendor?
  7. Which standards help you build a secure AI agent?

Why isn’t an AI agent that works in a demo ready for production yet?

In a demo, the agent operates in a controlled setting, with selected data and expected cases, whereas in production it meets your live systems, non-standard documents and sometimes people trying to manipulate it. Since an agent combines a model, tools and access, it is the design of those tools and that access that determines whether it will stay reliable under these conditions.

Two families of guardrails keep it in check: rules, meaning written instructions and skills, tell the agent what it should do, while technical controls, such as permissions, caps and the tools made available to it, limit what it can do. This difference becomes essential in production, since an agent can misinterpret or ignore an instruction, whereas the permissions enforced by your systems concretely limit the actions it can take.

Take an agent responsible for validating supplier invoices: the validation procedure, written and versioned, tells it to compare each invoice with the purchase order and the goods receipt, but it is its read-only access to the accounting system that ensures it will never issue a payment, a decision that belongs to the accounts payable manager. The versioned procedure also makes its work auditable, since you know at all times which version it was applying.

You also need to plan for unexpected situations: an agent can work well in the cases it was designed for, but without an appropriate stop mechanism, it may carry on with its task when it meets an unexpected situation and produce a convincing but wrong answer.

Before going into production, these guardrails are tested under representative conditions, with edge cases, unexpected data, manipulation attempts and failures of connected systems, and these checks need to be repeated whenever the agent’s model, tools or rules change.

How do you limit what an AI agent can do in your systems?

The safest approach is to apply the Zero Trust principle to the agent, under which nothing is granted by default and every access is verified, every time. For an agent, this principle rests on three pillars: a permission limited to what its task requires and to how long it lasts, an identity of its own, separate from those of people, and continuous monitoring of its access and actions.

Think of your office building, where a new employee receives a card that opens only the floors they need, while a contractor receives a temporary card that stops working when the contract ends. These rules feel natural for people, and yet some agents still run with an administrator’s credentials, with no end date. The key point comes down to one simple rule: an agent never inherits all the rights of the person using it. For example, your finance director has access to payroll data, whereas the agent that summarizes her emails has no need for it, so it must have its own identity and only the permissions its task requires.

This scope is completed by a closed list of authorized actions. A customer service agent can look up an order and create a follow-up ticket, and it could also propose a change of delivery address, subject to the necessary checks, while issuing a credit or closing an account stays out of its reach unless those actions are explicitly authorized. Caps on amounts, volumes and daily actions are added on top, and these limits are written into the permissions and into the connectors that link the agent to your systems, where every access request is verified.

Lastly, the agent receives only the data it needs: to analyze trends in insurance claims, an age bracket and a region are enough, with no name or address, which reduces the risk of leaks, since what the agent cannot see, it cannot disclose. All these limits put into practice the level of autonomy you have set for each agent.

How do you protect an AI agent from prompt injection and unexpected cases?

To protect an agent, you define in advance the situations where it must stop and hand the case over to a person, and you account for manipulation attempts by combining detection mechanisms, technical controls and limits on authorized actions. Prompt injection refers precisely to this kind of manipulation: someone slips malicious instructions into a document, an email or a web page the agent will read, in order to hijack its task. Agent goal hijacking ranks first in the OWASP Top 10 for Agentic Applications, published in December 2025.

Stop conditions are defined from concrete situations, such as a medical report that shows up in an auto insurance claim file, instructions hidden in an attachment or a refund that exceeds the authorized threshold, set for example at $500. When a manipulation attempt is detected, the action in question is blocked and, if needed, submitted for human review.

These pauses are easy to justify, because in an unexpected case, a person brings what the agent lacks, namely context, judgment and accountability, and a pause always costs less than a wrong action. Since these stop conditions reflect your business rules, your policies and your knowledge of your users, they are defined with business teams as much as with developers.

They also work in tandem with the permissions covered above: if an injection still manages to fool the agent, its limited access and closed list of actions restrict what it can do, and it is this combination of rules and technical controls that makes the whole setup robust.

How do you trace and audit an AI agent’s decisions?

You trace an agent’s decisions through a timestamped, protected log that answers four questions for each action: who acted, what was done, on what basis and with what result. For an auditor, an action without a trace is an action that cannot be justified, which is why this log should be designed from the start, at the same time as the agent itself.

  • Who acted: the agent, along with the person who made the request.
  • What was done: the actions, the tools used and the data consulted.
  • On what basis: the rules applied, the system version and the approvals obtained.
  • With what result: the changes made, the errors encountered and the decisions taken.

‍

The system version deserves special attention, since an agent’s behaviour changes when its model, skills or rules evolve. By keeping this information, you can trace the elements that contributed to a decision, even several months later, and understand which data, which rules and which system version were used, without necessarily reproducing the exact result: for a blocked transaction, for example, the log shows which agent flagged it, based on which data, under which version of the rule and which person approved the block.

The same log then helps you spot and correct an agent that makes mistakes, and it gives you a factual basis for granting it more autonomy or reducing it. It also makes it easier to explain automated decisions to the people they affect, since in Quebec, Law 25 sets out transparency and human review obligations when a decision is based exclusively on the automated processing of personal information.

The log itself must be protected, which means limiting the sensitive information recorded in it, controlling who can consult it and setting a retention period suited to your organization’s requirements.

How do you stop an AI agent and keep its costs under control?

To stop an agent, you need a tested kill switch that a person can use at any time and that does not depend on the vendor, and to control its costs, a consumption budget enforced technically for each agent. The test for a kill switch fits in one sentence: if you have to open a support ticket with your vendor to stop your agent, you do not have a kill switch.

A kill switch keeps the agent from continuing its actions without undoing those it has already carried out, which is why sensitive operations also call for correction or rollback mechanisms.

Costs call for the same rigour, since an agent caught in a loop can multiply calls without producing any useful result. Picture an agent that tries to reach a system that is down, fails, retries and keeps going like this all night: the next morning, no work has been done, yet the bill is very real. Three measures help you avoid this scenario:

  • A budget set in advance for each agent and enforced technically, through limits on calls, duration and consumption, so that the agent stops as soon as the limit is reached.
  • An alert before the bill, when volume or price changes, so you can react to a trend before it becomes expensive.
  • A non-AI solution for tasks that must run at all times, so that their continuity rests on a system you fully control.

‍

The distinction between an alert and a limit is decisive when designing the agent: an alert warns, whereas a limit stops, so it is the limit that protects your budget while your teams are asleep. For predictable tasks, coded rules and traditional automation also remain the most cost-effective choice.

How do you avoid depending on a single AI vendor?

You avoid this dependency by combining a tested fallback plan with an architecture that keeps you in control of your keys, your data and your choice of model. It all starts with a simple question: if your AI vendor became unavailable tomorrow morning, would your process stop with it? Unavailability is only one scenario among others, since your vendor can also change its prices or terms of use, retire the model you rely on or update it in a way that changes your agent’s behaviour.

The fallback plan has three parts: a manual procedure your teams still know, an alternative technology solution, such as another vendor or another model, and a tested switchover to another process. The word that matters here is “tested,” because a fallback plan that has never been tried may fail on the day you need it.

Data sovereignty starts with where your data is located, including logs, copies and backups, since a vendor can process your data in Toronto while keeping its debug logs in the United States. Depending on the sensitivity of your data and your regulatory or contractual obligations, some requirements become non-negotiable, which is why you should define the level of sovereignty you need before choosing a vendor. Three other dimensions complete the picture, and each one deserves to be verified and then written into the contract:

  • Governing law. A U.S. company can be required to hand over data to its authorities, even when that data is hosted in Canada, hence the value of a vendor whose entity and parent company fall under Canadian law, with the jurisdiction set out in the contract.
  • Vendor access. A support technician abroad who logs in to fix a problem gains access to your data, even if it has never left the country, which justifies requiring a list of authorized personnel based in Canada and cleared for that access.
  • Technical control. Your own encryption keys, portable data and a replaceable model let you regain control or switch vendors without rebuilding everything, while a log of vendor access shows you who has stepped into your environment.

‍

Which standards help you build a secure AI agent?

Several references can guide you, and each plays its own role: some serve to demonstrate risk management through certifications or attestations, while others provide technical recommendations for securing AI systems.

On the certifiable side, ISO/IEC 27001 covers information security and ISO/IEC 42001 covers AI management systems, while the SOC 2 Type 2 attestation is in high demand in North America. Three references then guide the build:

  • ISO/IEC 27090, published on October 14, 2026, provides guidance for understanding, detecting and mitigating threats specific to AI systems, such as data poisoning or model theft, across their entire life cycle, without being a certifiable management system.
  • The OWASP Top 10 for Agentic Applications, published in December 2025, identifies the ten risks specific to agents, from agent goal hijacking to identity and privilege abuse, including cascading failures and insecure communication between agents.
  • The Canadian standard CAN/DGSI 101:2025 sets minimum requirements for building ethics into the design and use of AI in small and medium-sized organizations, generally those with fewer than 500 employees.

‍

The first two references complement each other: ISO/IEC 27090 helps you understand and address threats specific to AI systems, while OWASP helps you identify the main risks of agentic applications and the measures to mitigate them. Since this landscape is evolving quickly, these references serve as starting points, to be completed according to your clients’ requirements and your industry.

AI agent guardrails in production, at a glance

  • The agent succeeds in the demo but fails in your live systems. Guardrail: technical controls on top of written, versioned rules. Owners: the development team, with process owners for the rules.
  • The agent accesses more than its task requires. Guardrail: Zero Trust, meaning minimal permissions, its own identity, a closed list of actions, caps and minimal data. Owners: development and IT security.
  • Prompt injection or an unexpected case hijacks the agent. Guardrail: stop conditions defined in advance, with the action blocked when manipulation is detected. Owners: business teams and development.
  • A decision cannot be explained. Guardrail: a timestamped, protected log that answers the four questions. Owners: development, with compliance.
  • The agent runs out of control or the bill spikes. Guardrail: a kill switch independent of the vendor, a technically enforced budget and an alert before the bill. Owners: development and IT operations.
  • The vendor becomes unavailable or changes its terms. Guardrail: a tested fallback plan, your own keys, portable data, a replaceable model and sovereignty clauses. Owners: architecture, procurement and legal.
  • The team lacks a reference for security best practices. Guardrail: ISO/IEC 27001, 42001 and 27090, the SOC 2 Type 2 attestation, the OWASP Top 10 and CAN/DGSI 101. Owners: security and compliance.

‍

Whatever level of autonomy you give an agent, your organization remains responsible for how it is used and for its consequences, which is why these guardrails are built in from the design stage rather than added after going into production.

‍