DEV Community

Cover image for AI Agent Security Best Practices: We Gave an AI Agent CRM Write Access and Ranked 12 Guardrails
Dhruv Joshi for Quokka Labs

Posted on

AI Agent Security Best Practices: We Gave an AI Agent CRM Write Access and Ranked 12 Guardrails

The uncomfortable 2026 security story is not that AI agents can be tricked. It is that “human approval” can be tricked too.

In August, AWS disclosed a prompt-injection flaw that could bypass a shell-tool consent gate; days later, NIST warned that model-only guardrails are not enough for agentic systems.

AI agent security best practices now start with a harder question: “What can a compromised agent change?”

We gave a CRM agent write access in a sandbox and ranked 12 controls by one standard: how effectively they reduced unauthorized actions, privilege abuse, and irreversible damage before a production deployment can proceed.

Get the 12-control checklist. If your agent can write to production systems, we’ll review its blast radius.

AI Agent Security Best Practices Change Once the Agent Can Write

A read-only copilot can expose data. A write-capable agent can corrupt it, trigger workflows, alter revenue records, or repeat an action at machine speed. That is why AI agent security best practices must move beyond prompt filtering into identity, authorization, runtime enforcement, approval, auditability, and recovery.

NIST’s August 27, 2026 guidance says agentic systems need strong identity and authorization foundations and warns that model-only guardrails are insufficient. AWS disclosed CVE-2026-18733, where indirect prompt injection could bypass a human consent gate. NVIDIA’s red team recommends deterministic controls outside the model.

What Actually Secures a Write-Capable AI Agent?

A secure production agent should have its own identity, short-lived credentials, narrowly scoped permissions, validated tool calls, runtime policy enforcement, approval for high-impact writes, and an immutable action trail. Assume prompt injection will eventually influence the model. Security comes from ensuring the agent still cannot exceed authorized records, fields, actions, destinations, rate limits, or transaction boundaries.

That is the center of agentic AI security. Quokka Labs applies this model across AI security services, testing, and production hardening.

Original Quokka Labs Evidence: Six Sandbox Attack Cases

What We Tested

We connected an AI agent to a sandbox CRM with controlled write privileges and exercised six failure modes: prompt injection, privilege escalation, cross-record action, duplicate actions, malicious tool output, and rollback failure.

The goal was not to prove the model was “safe.” It was to learn which LLM guardrails still held when the model made a bad decision.

Attack case Failure we tried to trigger Control that mattered most
Prompt injection Hidden text changes intended task Runtime authorization
Privilege escalation Prohibited field or action Scoped permissions
Cross-record action Wrong account/contact edited Record-level policy
Duplicate actions Same update runs twice Idempotency
Malicious tool output Tool response steers next action Output validation
Rollback failure Bad write cannot be reversed Compensating action

Why Prompt Filtering Is Not Enough

A prompt injection prevention tool can reduce malicious instructions reaching the model, but it should never be the final authorization layer. A write-capable agent must be treated as potentially compromised at runtime. The decisive control is whether external policy can deny an unauthorized action even when the model confidently requests it. Filtering improves detection; scoped authorization limits damage.

Ranking the 12 Guardrails

We ranked these AI agent security best practices by blast-radius reduction, enforcement reliability, and coverage across the six attacks.

Rank Guardrail Why it ranks here
1 Default-deny runtime authorization Blocks unauthorized actions outside the model
2 Per-agent identity + short-lived credentials Prevents shared-user impersonation
3 Object-, field-, and action-level scope Stops cross-record edits and privilege escalation
4 Runtime policy engine Enforces business rules before every write
5 Risk-based human approval Holds destructive, financial, or bulk changes
6 Strict tool schemas Rejects malformed or out-of-policy calls
7 Untrusted-content/tool-output inspection Reduces direct and indirect injection
8 Idempotency controls Stops repeated writes and triggers
9 Transaction boundaries Prevents invalid multi-step changes
10 Immutable audit trail Preserves actor, input, action, and outcome evidence
11 Reversible writes Makes recovery operational
12 Kill switch + rate/step limits Contains loops and fast failures

The Top Three Controls Deserve Priority

Scoped access for AI agents should be explicit: which CRM objects, which records, which fields, which operations, and under what conditions. “CRM write access” is not a permission model; it is a blast-radius statement.

For production agents, Quokka Labs’ agentic AI development services combine tool orchestration with permission design, evaluation, and governed deployment.

Human Approval is Necessary, but Not Sufficient

The AWS consent-gate flaw breaks a comfortable assumption: a confirmation dialog does not automatically create safety. Approval must sit on top of deterministic agent permission management, not replace it.

Require approval for bulk updates, deletes, exports, ownership changes, financial fields, or writes crossing tenant boundaries. Do not ask humans to approve routine low-risk actions repeatedly; NIST warns that excessive human-in-the-loop prompts can create consent fatigue.

What Should an AI Security Audit Checklist Verify?

An AI security audit checklist for production agents should verify five things: every agent has a unique identity; permissions are least-privilege and context-bound; high-risk actions are blocked or approved before execution; every tool call is attributable and logged; and every consequential write has a tested recovery path. If any control depends only on the model following instructions, treat it as advisory rather than enforceable.

Those checks are practical secure AI deployment best practices and should sit beside broader AI agent security best practices for production review.

Where AI Agent Security Tools Should Sit

The most valuable AI agent security tools operate in the action path, not only at the prompt boundary. They should inspect context, enforce policy, validate tool calls, control data movement, log decisions, and stop forbidden actions before the CRM accepts them.

Quokka Labs built LangProtect around that runtime-governance model for AI apps, agents, and MCP-connected environments.

Production Rule: Assume the Model Will Eventually Be Wrong

The strongest AI agent security best practices are designed for model failure. They make one compromised prompt boring: the agent hits a hard permission boundary, the denied action is logged, and the workflow stops without corrupting production data.

That is the standard Quokka Labs brings as an AI-native app development company with 15+ years of engineering experience: model intelligence inside deterministic software controls.

If your roadmap includes agents that write to CRM, ERP, support, finance, or internal admin systems, start with permissions and recovery before adding autonomy.

See how Quokka Labs approaches AI-native application development for systems where security, observability, and controlled execution are part of the architecture, not post-launch patches.

Top comments (0)