Encased.ai · Practical field guide
Agentic AI security: a guide to AI runtime guardrails
A practical guide to controlling what AI agents can do: where enforcement belongs, six real-world workflows, the people who buy and operate it, and the questions to ask before production.
What is AI agent security at runtime?
Runtime guardrails evaluate and constrain an agent’s actions while it operates. They sit at the boundary between a proposed action and its execution: sending an email, querying a database, running a command, moving money or calling an external API.
The central question is not just “is this response safe?” It is “is this agent authorised to perform this exact action, with these arguments, against this system, right now?” A runtime policy can allow routine work, hold a risky action for human review, or deny it outright.
Deterministic rules give predictable decisions for the conditions they cover. They do not guarantee complete safety: missing rules, weak credentials, disguised payloads and unprotected execution paths can still create risk. Strong deployments combine action policies, least privilege, isolation, monitoring and human accountability.
Runtime controls complement—not replace—other safeguards
| Control layer | What it contributes | What it does not guarantee |
|---|---|---|
| Prompt & response filters | Inspect model inputs and outputs for unsafe content, injection patterns or sensitive information. | They do not, by themselves, control which database, shell or external service an agent can reach. |
| Pre-launch evaluations | Measure performance and safety against test scenarios before release. | A passing evaluation does not guarantee safe behaviour with new inputs, tools or permissions. |
| Runtime action policies | Check a proposed tool call against permissions, limits and approval requirements. | They protect only the paths that actually pass through the enforcement point. |
| Infrastructure isolation | Constrain credentials, network access, processes and resource consumption. | They need deployment-specific engineering and do not explain the business intent of every action. |
The enforcement architecture: propose before execute
The critical design choice is placing the check before the side effect. An agent reporting that it already sent money or leaked a document is producing telemetry, not preventing the action.
01
Propose
Agent submits the tool and arguments.
02
Evaluate
Policy returns allow, hold or deny.
03
Review if held
An authorised person decides.
04
Execute or stop
Integration honours the verdict.
Separate decision-making from enforcement. A gateway can return “block”; the tool wrapper or infrastructure must make execution impossible after that decision. Remove direct credentials or alternative paths that would let the agent ignore the gateway.
Treat pending as not approved. A held action stays unexecuted until an authorised decision is available. The integration must handle timeouts, retries and duplicate requests without executing the same action twice.
Give kill switches a concrete meaning. Denying one proposal, revoking a gateway key, cancelling a worker and revoking a cloud credential are different operations. Ask which ones a product actually performs and how quickly the downstream system responds.
Record the outcome, not just the proposal. Keep a traceable decision record and execution acknowledgement, with sensitive fields minimised. A policy verdict alone cannot prove what happened downstream.
Applied scenarios
Six practical use cases for AI runtime guardrails
These are representative real-world workflows and illustrative test scenarios, not claims about deployed Encased customers. Each separates the desired protection from what the current gateway can do on its own.
USE CASE 01
A research agent tries to leak internal documents
An enterprise research assistant retrieves internal wiki pages alongside public web content. A poisoned page instructs it to upload its working context to an attacker-controlled endpoint.
- Proposed action
- The agent proposes an HTTP POST to an unapproved host with internal text in the request body.
- Required guardrail
- An enforced destination allow-list rejects the outbound request. Content checks can also flag secrets or personal data in the proposed payload. Apply checks to redirects and secondary requests, not just the first URL.
- Operator response
- Deny the request, retain a redacted record of the destination and policy decision, and investigate the source document before resuming the task.
- Acceptance test
- Use a mock unapproved destination and synthetic document content. Confirm that no request reaches the destination, including through a redirect or an alternate HTTP client.
Encased boundary: Encased’s gateway checks submitted payloads for configured patterns. Actual host allow-listing and socket-level blocking require enforced customer-side integration; the gateway alone is not a network firewall.
USE CASE 02
A customer-support agent attempts an unauthorised refund
A support agent reads a ticket that impersonates a manager and asks it to enter debug mode, bypass policy and refund an order. Obfuscated text or invisible characters may hide the instruction.
- Proposed action
- The agent calls a refund tool even though the ticket does not carry trusted approval.
- Required guardrail
- Require review for the refund tool independently of what the ticket says. Set monetary limits, verify the customer and order in trusted systems, and normalise identifiers. An instruction inside a ticket is not authorisation.
- Operator response
- Hold the proposed action. A reviewer checks the amount, recipient, order and original request, then approves that specific action or rejects it.
- Acceptance test
- Submit the same synthetic refund request with ordinary and obfuscated ticket text. The tool policy should require approval in both cases, and no refund should execute while the request is pending.
Encased boundary: Encased can quarantine configured approval tools and amounts over a workspace threshold. It does not independently verify a customer’s refund eligibility or detect every form of semantic drift.
USE CASE 03
A coding agent gets trapped in a retry loop
A code-review agent repeatedly runs a failing linter. Each retry invokes the model again, consuming budget without making progress. Multiple spawned agents can amplify the problem.
- Proposed action
- The same tool and arguments recur rapidly while model usage climbs.
- Required guardrail
- Track repeated calls, elapsed time, concurrent children and actual model spend. Use explicit retry limits and a circuit breaker shared across the relevant workers. A financial amount in a tool payload is not a model-spend meter.
- Operator response
- Stop new work, cancel in-flight tasks where supported, and suspend the affected agent’s access. Preserve the failure context so a human can fix the linter rather than restart the same loop.
- Acceptance test
- Force a test linter to fail repeatedly. Confirm the retry ceiling is enforced across workers and that calls to the model stop, not just that a warning appears on a dashboard.
Encased boundary: Encased receives runtime telemetry and demonstrates loop containment in the simulator. Production retry counting, model-spend caps and cancellation must be implemented in the runtime integration; reporting telemetry does not itself stop a loop.
USE CASE 04
A finance agent proposes a destructive database operation
An invoice-processing agent reads an attachment containing instructions to remove production invoice records. It mistakes those instructions for a maintenance task.
- Proposed action
- The agent submits SQL containing DROP TABLE production_invoices.
- Required guardrail
- Use a read-only database role by default and hold destructive operations for review. Parse or constrain SQL at the database boundary; string-pattern matching is useful defence in depth, not a complete SQL security mechanism.
- Operator response
- Keep the SQL unexecuted while a reviewer checks the connection, affected records and business need. Deny the action if it is outside the agent’s remit and rotate exposed credentials if necessary.
- Acceptance test
- Use a disposable database. Check both recognised destructive statements and alternative paths such as stored procedures. Confirm the execution account cannot make prohibited changes even if an agent bypasses its wrapper.
Encased boundary: Encased quarantines recognised destructive SQL patterns submitted to the gateway. The caller must honour that verdict; the gateway cannot undo a query that was already executed or remove database permissions itself.
USE CASE 05
A sales agent includes personal data in an outbound message
A sales assistant drafts an email using CRM notes. The draft accidentally includes a customer’s phone number or a payment-card number copied from an unrelated record.
- Proposed action
- The agent proposes sending the draft to an external recipient.
- Required guardrail
- Check the outgoing payload, recipient and purpose before sending. Pair deterministic data-pattern checks with data minimisation and, where needed, specialised DLP. Distinguish numeric order IDs and timestamps from actual personal-data formats.
- Operator response
- Hold the message, show masked findings to the reviewer and create a corrected draft. Approval should apply to the exact recipient and content reviewed, not a later modified message.
- Acceptance test
- Try synthetic email addresses, formatted phone numbers and test card numbers. Also test a routine timestamp and order ID: those should not be held just because they contain many digits.
Encased boundary: Encased’s content scan flags supported patterns and masks finding samples. It is not comprehensive DLP: names, addresses, contextual identifiers and encoded data may need other controls. Masked findings do not mean the entire stored action payload is redacted.
USE CASE 06
A deployment agent attempts a production release
An engineering assistant prepares a fix and then attempts to deploy it directly to production. Its access is broader than the change it was asked to make.
- Proposed action
- The agent calls a production deployment tool without a verified release approval.
- Required guardrail
- Separate staging and production credentials, restrict tool access by environment, and require review for production deployment. Check the exact artifact and target against the approved change.
- Operator response
- Hold the release until an authorised operator approves it. Reject deployment to the wrong environment and retain the decision alongside the change record.
- Acceptance test
- Attempt a staging deployment, an unapproved production deployment and a modified artifact after approval. Only the action that meets the release policy should run.
Encased boundary: Encased can require review for configured deployment tools. Artifact verification, CI/CD permissions, approval binding and rollback remain responsibilities of the release integration.
Buyer personas: who needs runtime guardrails?
The budget owner, integration owner and daily reviewer are often different people. A successful purchase aligns all three before agents gain production permissions.
CISO / security leader
Reducing the blast radius of agents with access to sensitive systems.
Responsibility: Owns the risk decision and security budget; works with engineering on enforcement.
Buying criteria: Ask for bypass tests, credential boundaries, incident response ownership and a documented failure policy. A polished demo is not evidence of production containment.
AI platform / engineering lead
Shipping useful agents without turning every tool call into an incident.
Responsibility: Owns integration, reliability, rollout and on-call operations.
Buying criteria: Evaluate supported tool paths, decision latency, timeouts, idempotency, policy versioning and test coverage. Check what happens when the review service is unavailable.
Security engineer / AppSec team
Stopping injection-driven misuse, exfiltration and excessive permissions.
Responsibility: Builds the threat model, attack tests and infrastructure controls.
Buying criteria: Test alternate execution paths, redirects, encoded payloads and privilege escalation. Verify that denied actions never reach the downstream system.
Operations / finance leader
Keeping refunds, payments and customer-facing actions within authority.
Responsibility: Defines business thresholds and supplies accountable reviewers.
Buying criteria: Evaluate approval permissions, queue ownership, response times, exact-action approval and separation of duties. Measure how often legitimate work is delayed.
Governance / compliance lead
Showing who authorised an action and which policy applied.
Responsibility: Defines evidence, retention, access and review requirements.
Buying criteria: Request sample audit records, export formats, retention terms and data-handling documentation. A decision log supports governance; it is not a SOC 2 or ISO 27001 certification.
Founder / product owner
Moving from a convincing agent demo to a controlled customer pilot.
Responsibility: Coordinates budget, customer commitments and specialist security help.
Buying criteria: Start with one bounded workflow and clear success criteria. Buy the controls you can verify now, not a promise that every autonomous action will be safe.
A deployment playbook: from pilot to production
- 01
Inventory the agent’s reach
List every tool, credential, data source, destination and environment. Identify who owns each system and which actions are irreversible. Include child agents and background jobs.
- 02
Define explicit authority
Start with a narrow tool allow-list and least-privilege credentials. Set business thresholds and decide which actions need review. Make unknown-tool handling explicit rather than relying on defaults.
- 03
Integrate the execution boundary
Submit actions before executing them, honour held and denied verdicts, and remove bypass paths. Choose timeout behaviour for each risk class. Observation-only mode can help tune policies, but it is not containment.
- 04
Run adversarial and routine tests
Test poisoned documents, destructive operations, sensitive payloads and repeated calls alongside normal business tasks. Check downstream systems for actual side effects. Measure false holds as well as missed threats.
- 05
Rehearse human review and recovery
Assign reviewers, escalation coverage and a response target. Rehearse rejection, suspension, credential rotation and safe restart. Confirm that an approval cannot be reused for a different action.
- 06
Roll out gradually and monitor drift
Begin with a bounded pilot, review incidents and expand only after acceptance tests pass. Retest when tools, prompts, models, permissions or policies change.
Measure usefulness as well as security. Track blocked test attacks, legitimate actions held for review, decision latency, queue age, integration failures and duplicate side effects. Set your own acceptance targets before the pilot; there is no universal safe score.
How to evaluate AI agent security tools
Compare action-policy gateways, agent-framework controls and infrastructure enforcement against your workflow. A tool’s category label matters less than whether it can stop the specific action you need controlled.
- Coverage
- Which tool, database, network and model-call paths are intercepted? What stops an agent from using another path?
- Policy depth
- Can you enforce tool permissions, amounts, recipients, destinations and environment boundaries? Which checks are deterministic, and which rely on a model?
- Failure behaviour
- If the gateway times out, does the action stop, wait or proceed? Can risky paths fail closed without silently disabling protection?
- Human review
- Who may approve? Does approval bind to the exact action? How are expiry, duplicate execution and reviewer availability handled?
- Data protection
- What payloads are stored? Are secrets removed before logging? How are access, retention, deletion and region requirements handled?
- Operational evidence
- Can you trace a decision to the agent, workspace, policy and outcome? Can you prove a blocked action never executed?
- Commercial fit
- What does the plan include? Compare seats, usage, implementation work, support, model costs and independent security review—not just subscription price.
For Microsoft Copilot or another managed agent platform, first check which supported tool connectors and extension points can enforce pre-action decisions. Do not assume a third-party gateway can intercept every native action. Start with the platform’s permissions and data controls, then validate any additional integration path.
Scope and limitations
What Encased supports today
The live action gateway
- Authenticated REST proposals and telemetry, scoped to the connected workspace.
- Workspace policies for blocked and allowed tools, approval tools, recognised destructive patterns, monetary thresholds and supported secret or personal-data patterns.
- Allow, block or quarantine decisions, with held proposals appearing in the workspace review queue.
- Role-checked review decisions with audit entries; connected agents can poll for the result.
What still needs runtime integration
- Pre-execution interception and reliable enforcement of gateway verdicts on every protected tool path.
- Network egress controls, process isolation, model-spend circuit breakers and downstream credential revocation.
- Workflow-specific validation, complete DLP, execution acknowledgements and exact-action approval binding.
- Independent security testing before production reliance. Simulator animations are demonstrations, not proof of those protections being deployed.
Encased’s current gateway checks are not the same as the network, process and token-containment layers illustrated in the simulator. The platform is not independently SOC 2 audited or ISO 27001 certified. Review the security information and compliance disclosures before making procurement commitments.
For the integration contract, start with the agent connection guide. For commercial options, compare plans and pricing and confirm the scope of any implementation work separately.
Start with the workflow you need to protect
Explore representative attacks in the simulator, or discuss your agents, permissions and highest-risk actions with the Encased team before a pilot.
