Siam Thanat Hack Co., Ltd.

AI-Native SDLC Security Engineering: Securing AI Coding Agents Against Poisoning and Sandbox Evasion

This guide uses the Anthropic AI-Native SDLC Playbook and coding-agent vendor security documentation to recommend risk-based controls. It is not a law or certification standard.

Overview
Target Audience
Engineering and security owners adopting AI coding agents, with controls selected for the product and environment
Testing and Review Frequency
Check behavior and permissions on adoption or tool changes. Select tests and review depth for task risk. These are STH engineering recommendations.
Assessment Scope
Permissions, approvals, hooks, sandboxing, networking, dependencies and release evidence
Relevant Risks
Context poisoning, credential theft, unauthorized commands and untrusted dependencies

AI-native SDLC is engineering guidance, not a regulatory standard

This guide uses the Anthropic AI-Native SDLC Playbook and coding-agent vendor security documentation to recommend risk-based controls. It is not a law or certification standard.

AI coding agents: four security gates: Limit permissions, Inspect tool calls, Isolate execution, Review before release
AI coding agents: four security gates

Select permissions, hooks, sandboxing and review for task risk. Verify actual boundaries and do not treat a single control as complete protection.

  • Limit permissions — Scope files and commands
  • Inspect tool calls — Hooks reduce risk, not all attacks
  • Isolate execution — Sandbox and control network access
  • Review before release — Tests, review and evidence
  • The playbook connects planning, design, building, testing, deployment and maintenance through verifiable requirements and execution evidence.
  • Context poisoning can arise when an agent ingests untrusted repository, issue or pull-request text as instructions.
  • Overbroad file, command or network permissions can expose data and credentials even when the agent starts in a designated workspace.
  • Verify the identity, provenance and version of proposed dependencies. A lockfile alone does not establish that a package is safe.
  • Evaluate third-party agent skills against the OWASP Agentic Skills Top 10 (an OWASP Incubator v1.0 public-review draft, 2026, AST01 to AST10), which the OWASP project ties to SKILL.md, skill.json and manifest.json packages depending on the platform, to reduce the risk of malicious skills, over-privileged access and update drift.

Limit permissions and inspect tool calls

Combine supported permissions, approvals and hooks. Distinguish organizational control recommendations from the capabilities of each product.

Coding-agent least privilege and tool hooks: Scope Files, CLI and Secrets, Vendor Rule Controls, Hook Inspection and Bypass Tests, Context Fencing and Approval Gates
Coding-agent least privilege and tool hooks

Combine narrow permissions and inspected hooks with real OS isolation because prompt delimiters alone are not security boundaries.

  • Scope Files, CLI and Secrets
    Restrict paths and network destinations to the task while keeping secrets out of context
  • Vendor Rule Controls
    Configure product controls such as Codex prefix_rule (where allow leaves the sandbox) and sandbox.json
  • Hook Inspection and Bypass Tests
    Cover every execution path without assuming hooks or AST checks block all injections
  • Context Fencing and Approval Gates
    Mark untrusted inputs and require human approval before high-impact or unsandboxed actions
  • Scope files, commands and network destinations to the task, and keep secrets out of agent context and runtime environments.
  • Configure product-specific execution policies where supported, such as OpenAI Codex prefix_rule controls (allow, prompt, forbidden), which OpenAI labels experimental and where allow runs a command outside the sandbox so rules should stay narrow, or Cursor Auto-review and .cursor/sandbox.json filesystem and network allowlists, where Cursor states Auto-review is not a security boundary and should be paired with the sandbox.
  • Hooks can inspect parameters and deny unauthorized actions. Cover the relevant tools and test bypass paths. Hooks or AST inspection do not detect all prompt injection.
  • Context fencing can label untrusted data. Delimiters and prompt sanitizers are not complete security boundaries.
  • Define accountable approval or policy gates for high-impact actions, including unsandboxed execution and expanded access.

Verify sandbox and network boundaries in operation

Use mechanisms supported by the tool and operating system, and test their actual boundaries. A container or mode name alone does not prove complete host isolation.

Verify coding-agent sandbox and egress boundaries: Inspect Mounts, Symlinks and Creds, Restrict Egress and External Tools, Audit Unsandboxed Modes and OS Gaps, Resource Caps and Breakout Reality
Verify coding-agent sandbox and egress boundaries

A mode or container label does not prove host isolation. Verify filesystem mounts, symlinks, egress paths, and fallback flows in actual operation.

  • Inspect Mounts, Symlinks and Creds
    Audit readable and writable files and choose containers or microVMs proportionate to risk
  • Restrict Egress and External Tools
    Allow only required network hosts and inspect helper tools running outside the sandbox
  • Audit Unsandboxed Modes and OS Gaps
    Test privilege-escalation prompts and parity across local machines, cloud runners, and OS builds
  • Resource Caps and Breakout Reality
    Limit CPU and disk and log events because sandboxing reduces risk without preventing every breakout
  • Limit file reads and writes, inspect mounts, symlinks and accessible credentials, and choose containers or microVMs where appropriate to risk.
  • Restrict egress to destinations required by the task, including any external tools operating outside the sandbox.
  • Check sandbox-disabled modes, privilege escalation paths and differences between local, cloud and supported operating systems.
  • Apply appropriate resource limits and monitoring. Sandboxing reduces risk but does not prevent every breakout.

Test, review and retain evidence before release

Select testing and review depth for change risk. CI and accountable owners should enforce the organization release policy.

AI-native CI/CD gates, AISVS checks, and audit trails: Negative Tests, SAST, SCA and Secrets, Verify Code and MCP Against AISVS v1.01, Protected Branches and Human Review, Provenance and Redacted Audit Logs
AI-native CI/CD gates, AISVS checks, and audit trails

Retain tool versions, diffs, test evidence, and approvals in redacted form to support auditability without storing raw prompts.

  • Negative Tests, SAST, SCA and Secrets
    Test changed behavior and negative cases with scans proportionate to language and risk
  • Verify Code and MCP Against AISVS v1.01
    Check AI-generated code against Appendix C and MCP controls under Chapter C10 (39 active of 40 IDs)
  • Protected Branches and Human Review
    Gate high-impact releases under policy rather than enforcing one universal two-person rule
  • Provenance and Redacted Audit Logs
    Verify dependencies beyond SRI and redact secrets instead of storing raw prompt transcripts
  • Test changed behavior and relevant negative cases. Apply SAST, SCA and secret scanning where appropriate to language, scope and risk.
  • Verify AI-generated code and MCP server integrations against OWASP AISVS v1.01 Appendix C (AI-Assisted Secure Coding) and Chapter C10 (MCP Security, 40 requirement identifiers with 39 active).
  • Use protected branches and release gates under organizational policy, with human review for high-impact changes. The playbook does not mandate a two-person rule for every task.
  • Verify dependency identity and provenance alongside lockfiles and tests. Subresource integrity is not a universal dependency-verification mechanism.
  • Retain necessary tool versions, changed files, test results and approvals. Redact secrets and set retention periods rather than recording every prompt and tool parameter indiscriminately.

References and Assessment Scope

Summary of source references, assessment scope, and review timing in the context of each item.

Reference Topic Assessment Scope Testing Cycle
Anthropic AI-Native SDLC Playbook AI-native SDLC is engineering guidance, not a regulatory standard This guide uses the Anthropic AI-Native SDLC Playbook and coding-agent vendor security documentation to recommend risk-based controls. It is not a law or certification standard. According to applicable scope and service risk, not a universal testing cycle
Vendor permission and hook documentation Limit permissions and inspect tool calls Combine supported permissions, approvals and hooks. Distinguish organizational control recommendations from the capabilities of each product. According to applicable scope and service risk, not a universal testing cycle
Vendor sandbox documentation Verify sandbox and network boundaries in operation Use mechanisms supported by the tool and operating system, and test their actual boundaries. A container or mode name alone does not prove complete host isolation. According to applicable scope and service risk, not a universal testing cycle
STH release gate recommendations Test, review and retain evidence before release Select testing and review depth for change risk. CI and accountable owners should enforce the organization release policy. According to applicable scope and service risk, not a universal testing cycle

Implementation Checklist

Select items your organization has completed. The percentage shows selected items only and does not assess security or compliance.

0%

Frequently Asked Questions (FAQ)

Key answers and practical guidance addressing common compliance questions.

How can context poisoning occur?

Context poisoning can arise when an agent ingests untrusted repository, issue or pull-request text as instructions.

Do hooks and context fencing prevent all prompt injection?

Hooks can inspect parameters and deny unauthorized actions. Cover the relevant tools and test bypass paths. Hooks or AST inspection do not detect all prompt injection. Context fencing can label untrusted data. Delimiters and prompt sanitizers are not complete security boundaries.

Does a container or sandbox remove all risk?

Use mechanisms supported by the tool and operating system, and test their actual boundaries. A container or mode name alone does not prove complete host isolation. Restrict egress to destinations required by the task, including any external tools operating outside the sandbox.

Official source documents

Anthropic AI-Native SDLC Playbook and vendor security documentation

Go to the official source

Request a quote