Zero Labs
Industry News / AI

Enforcing SAIF at Runtime

Source · Towards AI By Paul Williams

From the publisher’s feed, collected in the ZeroLabs newsroom.

Operationalizing Google’s Secure AI Framework with MandrelIf approved, please withhold publication until 8:00AM ET TuesdayEnterprise security teams have spent two years building governance committees, compiling threat matrices, and publishing AI principles. The consensus document in regulated enterprises is Google’s Secure AI Framework (SAIF). SAIF provides an indispensable conceptual foundation. It articulates the core tenets necessary to secure artificial intelligence: expand security foundations, extend detection and response, automate defenses, harmonize controls, adapt controls to context, and contextualize risks.The structural breakdown occurs when an engineering team attempts to translate these tenets into production software.In traditional enterprise IT, policy maps cleanly to infrastructure. A firewall rule translates directly into an iptables filter or a cloud security group. An access policy maps to an OAuth scope enforced by an API gateway. In autonomous AI systems, however, architects routinely commit a classic category error: they attempt to enforce high-level security policies through natural language prompts. They inject instructions such as “Never disclose customer records” or “Only invoke approved financial tools” into system contexts, expecting a probabilistic language model to act as a deterministic security perimeter.Floating-point matrices do not enforce zero-tolerance invariants. As analyzed in my last article, when an autonomous agent mesh executes dynamic multi-hop delegations, decomposes unstructured requests, and calls external tools, policy guidelines enforced inside the context window collapse under attention degradation and indirect prompt injection.Moving SAIF from a static compliance checklist into an operational architecture requires a deterministic runtime kernel. Security policies must be decoupled entirely from model weights.Generated by Nano BananaThe Policy-to-Runtime Chasm: Why SAIF Cannot Live in PromptThe core vulnerability in modern agent deployments is the belief that safety guidelines can be enforced by the component being governed.When an engineer relies on system instructions to enforce data protection or tool authorization, the model is asked to serve simultaneously as the untrusted computing payload and the trusted execution sandbox. This violates first principles of systems security. A transformer operates probabilistically. It calculates token completion probabilities based on mathematical weights and historical training distributions. It possesses no native concept of privilege rings, memory isolation, or non-bypassable constraints.Three failure modes inevitably manifest when governance policies live inside model context:Attention Attenuation: As an agent navigates a complex workflow, tool outputs, schemas, and historical dialogue accumulate in the context window. As the sequence length expands, the relative attention weight assigned to the initial system prompt decays. Under heavy token load, models routinely disregard early negative constraints.Adversarial Payload Smuggling: Autonomous agents consume untrusted external data, including web pages, emails, customer tickets, and database records. When an agent processes untrusted inputs, an indirect prompt injection payload can override system instructions. The model cannot reliably distinguish developer directives from external data payloads.Lack of Uniform Refusal Semantics: Prompt-instructed guardrails fail probabilistically. A prompt guardrail that achieves 99.5 percent compliance on evaluation suites will generate five thousand security violations across a million production requests. In regulated environments, compliance is an absolute invariant.Security boundaries must exist completely outside the model context, a principle explored in The Context Window Is Not a Security Boundary. The language model should be treated strictly as an untrusted, probabilistic intent generator. All authorization, spend bounding, rate limiting, and network egress must be managed by an out-of-band deterministic runtime proxy.Threat Topology in Multi-Agent Tool MeshesSingle-agent systems possess a constrained blast radius. The developer binds an LLM to a script, configures three specific API wrappers, and monitors execution logs.Enterprise architectures, however, increasingly rely on agentic meshes. In these topologies, autonomous agents interact dynamically over a network. A primary orchestrator receives user queries, decomposes objectives into execution DAGs, discovers specialized sub-agents, and delegates intermediate tasks.Simplified 3-stage identity architectureThis multi-hop architecture introduces serious structural vulnerabilities:Unconstrained Blast Radius: Monolithic agents often inherit broad enterprise credentials. If a specialist sub-agent tasked with analyzing vendor invoices is compromised via prompt injection, an attacker can exploit those ambient credentials to read internal payroll records.Identity Smuggling (OWASP AGENT-09): When an orchestrator delegates tasks to specialized workers, human caller context is frequently dropped. Downstream agents execute actions using a generic shared service account. This erases audit trails, violates statutory requirements such as 31 U.S.C. § 5318(g)(2), and prevents fine-grained database authorization.Recursive Loop Exhaustion (OWASP AGENT-05): Autonomous agents iterate when attempting to resolve complex errors. If an agent encounters an unhandled API error, it can enter recursive retry loops. Without deterministic circuit breakers, unconstrained agents generate runaway cloud compute bills and exhaust downstream vendor API quotas.Tool-Use Abuse (OWASP AGENT-01): The emerging Model Context Protocol (MCP) standardizes how agents discover and execute tools. MCP servers run as external processes. If an agent executes an unvalidated tool call against a compromised or poorly isolated MCP server, the host system is exposed to arbitrary code execution or filesystem traversal.Generated by Nano BananaThe Architectural Bridge: Decoupling Policy from Model WeightsBridging the gap between SAIF principles and execution mechanics requires decoupling policy from model cognition.In mechanical engineering, a mandrel provides internal support and defines the exact shape of a workpiece during fabrication. As I explain in my article about the genesis of the Mandrel Project, the Mandrel Project applies this principle to autonomous agents: it establishes a deterministic, immutable axis around which probabilistic agent actions are shaped and constrained.The architecture relies on three load-bearing infrastructure mechanisms:Privilege escalation occurs when machine identity and human authorization are conflated. Mandrel implements a dual-badge compound identity model:Machine Identity: Every agent workload in the mesh receives a cryptographically verifiable SPIFFE ID (e.g., spiffe://mandrel.internal/ns/finance/sa/ledger-specialist) backed by mutual TLS (mTLS).Human Delegation Context: The human operator’s authentication token is exchanged at turn boundaries using RFC 8693 (OAuth 2.0 Token Exchange). As execution traverses from orchestrator to specialist, the token undergoes dynamic scope attenuation: intermediate hops strip unnecessary privileges, ensuring downstream sub-agents only possess the minimum scopes required for their discrete task.Declarative Boundary Contracts (The Mandrel Spec)Instead of embedding behavioral constraints in prompt prose, operational boundaries are defined in a machine-readable schema. The Mandrel Spec v1.0 standardizes the agent’s structural risk envelope before deployment.https://medium.com/media/87d49f25bc9bf79de69788c6327c86b8/hrefOut-of-Band Runtime Interception (The Collet Proxy)The operational heart of the system is the Collet proxy. Written in Go for low latency and memory safety, the Collet runs as an out-of-band interceptor alongside the agent workload.The Collet intercepts ingress invocations and egress tool calls. Before the agent processes an incoming turn, the Collet validates the compound identity badge, enforces sender-constrained tokens via RFC 9449 (DPoP), checks hop depth limits ( max-hops-allowed), verifies delegation volume ( max-delegations), and asserts that the target endpoint appears in the declared egress allowlist ( egress-spiffe-targets). If an upstream authorization service or policy check fails, the Collet fails closed, terminating execution immediately.Operationalizing the Six SAIF Pillars with MandrelGoogle designed SAIF around six foundational pillars. The following table demonstrates how high-level SAIF guidance maps directly to deterministic infrastructure controls within the Mandrel architecture.The Architectural Frontier: Closing the Remaining Posture GapsWhile the Mandrel Spec v1.0 and the Collet proxy operationalize the primary network, identity, and volume constraints of SAIF today, achieving the full security posture Google envisions leaves three significant industry gaps. These capabilities represent active architectural specifications on the Mandrel Roadmap rather than shipping primitives, forming the engineering roadmap required to harden autonomous meshes completely:The Tool Sandboxing Gap (WebAssembly for MCP): Model Context Protocol (MCP) servers currently execute as local child processes over standard I/O or as external HTTP endpoints. Tool isolation relies entirely on host operating system permissions and network firewalls. Full zero-trust tool execution demands that tool binaries execute inside an isolated WebAssembly (Wasm) runtime (such as Wasmtime). Under this roadmap model, the Collet will dispatch tool calls into a restricted Wasm sandbox with zero access to the host filesystem, memory, or network unless explicitly enumerated in the spec. This moves tool safety from process trust to mathematical sandbox isolation.The Semantic Verification Gap (Adversarial Spec Fuzzing): The mandrel-cli validate tool enforces syntactic validity, schema conformance, and structural rule checks today, flagging unclaimed extensions or dead SPIFFE references via deterministic E-codes. However, static checks cannot prove semantic separation between similar intent labels. If an engineer specifies overlapping intent taxonomies, an orchestrator can still be misled by adversarial user prompts. Closing this gap requires shifting adversarial simulation left: running automated synthetic red-team prompt generation in CI/CD pipelines (mandrel-cli simulate --adversarial) to stress-test intent taxonomies before promotion.The Poisoned Context Gap (Out-of-Band Memory Sanitization): Mandrel allows agents to declare persistent state claims (spec.network.state-claim), backed by external stores such as Valkey or Redis. Long-term memory introduces a persistent prompt injection vector: an agent processing untrusted external data might write an adversarial instruction into memory as a factual summary, which then poisons reasoning contexts on subsequent turns. Closing this gap requires an active inspection hook on state writes, using platform intent classifiers to scan persisted facts for instructional phrasing before they enter storage.Runtime Reality: Kubernetes Sidecars vs Managed PlatformsArchitectural patterns are constrained by their deployment targets. Designing a zero-trust runtime requires acknowledging the fundamental trade-offs between self-managed container orchestration and managed serverless runtimes.Generated by Nano BananaMandrel was engineered from first principles around the Kernel Isolation Model. In a Kubernetes cluster managed by the Gantry Operator, the Collet runs as a dedicated sidecar sharing the pod network namespace. An initialization container configures Linux iptables REDIRECT rules, routing all inbound and outbound TCP traffic through the Collet and an Envoy proxy.This reference model guarantees transparent interception: the agent application code requires zero modifications or SDK imports. All egress network traffic, tool requests, and delegation calls are captured at the transport layer, as described in Mandrel’s Egress Governance Architecture.When deploying across alternative runtimes, Mandrel adapts its enforcement pattern according to documented Deployment Variants:Serverless Multi-Container (Cloud Run / AWS Fargate): Operates as a co-located container group where the Collet serves as the primary ingress reverse proxy, asserting compound identity before forwarding requests to the agent container over localhost.Managed Ecosystems (Vertex AI Agent Engine / Bedrock): For opaque platforms where sidecars are unavailable, Mandrel registers as a custom pre-flight tool or Lambda layer. The runtime invokes the Mandrel endpoint to certify user intent, scopes, and delegation budgets before execution proceeds.Framework-First Execution (LangGraph / AutoGen): In code-first Python agent graphs, Mandrel integrates as a state-reducer node or proxy agent middleware. It utilizes native framework interrupts (such as LangGraph interrupt()) to handle governance challenges and enforce permitted-delegates constraints.Edge and Bare Metal Plumbings: In unmanaged environments, the agent binds exclusively to localhost, while the Collet exposes the public interface via static port offsetting or Docker Compose private networks.The architectural trade-offs must be stated plainly. Moving from a Kubernetes sidecar to a Cloud Run proxy or Vertex AI pre-flight tool sacrifices transport-layer transparency: agents must be configured explicitly to dispatch outbound calls to the proxy address rather than communicating directly over the network.Furthermore, egress governance on managed serverless platforms shifts from per-agent granularity to platform perimeter security via VPC Service Controls. While this represents a boundary trade-off, it preserves the core value proposition: declarative boundary contracts, scope attenuation, turn volume caps, and signed audit provenance remain fully enforced.Operational Lessons: What Breaks in ProductionDeploying autonomous agent meshes into production environments reveals failure modes that rarely appear in sandbox testing. These operational lessons reflect hard-won architectural experience:In-Process State Tracking Collapses Under Horizontal AutoscalingA common architectural defect is tracking session token spend and delegation fan-out in container memory. In production, orchestrator workloads scale dynamically across multiple pods. If an orchestrator delegates ten concurrent sub-tasks, these requests hit different container replicas. In-process counters suffer immediate state desynchronization, allowing agents to violate global concurrency limits and burn through turn budgets. Concurrency and spend tracking must be anchored in an external, low-latency distributed cache using atomic increment operations with strict TTL expirations.Fail-Open Configurations Guarantee Security BreachesWhen configuring runtime proxies, engineers frequently default to permissive fail-open postures to prevent workflow interruption during network hiccups. In an autonomous agent system, a timeout to an authorization provider, policy registry, or token validation service must result in immediate termination of the execution turn. If an agent cannot definitively verify its operational envelope, proceeding probabilistically guarantees data disclosure and unconstrained execution loops.Unattenuated Token Forwarding Creates Instantaneous Root EscalationWhen an orchestrator receives an initial OAuth token containing administrative permissions, passing that identical bearer token to downstream sub-agents creates a catastrophic blast radius. If a specialist sub-agent is compromised through indirect prompt injection, the attacker inherits the full administrative authority of the initiating user. The proxy layer must actively attenuate credentials at every hop, stripping unneeded scopes and enforcing single-use proof-of-possession constraints.The Operationalization Trajectory: An Actionable PlaybookMoving an enterprise from unmanaged experimentation to a governed agentic mesh requires an incremental adoption trajectory. Workloads advance across four distinct operational maturity tiers as defined in the Mandrel Workload Maturity Model:Generated by Nano BananaTier 1: Sandbox (Private) Rapid prototyping using read-onlyMCP tool servers. Bind workloads to baseline OIDC identity scopes. Capture all execution traces in OpenTelemetry to establish baseline token costs, call frequencies, and latency profiles.Tier 2: Trusted (Verified) Author formal Mandrel Specs for every deployed agent. Enforce static validation viamandrel-cli validate in CI pipelines to assert schema conformance, E-code constraints, and platform policy compatibility. Provision SPIFFE machine identities and mandate Human-in-the-Loop (challenge-always) for high-variance actions.Tier 3: Federated (Discoverable) Realized Specs are cryptographically signed and published to a Promotion Authority (the managedMetrology Lab, a self-hosted instance, or an offline CI signing pipeline). Orchestrators dynamically discover capabilities and route tasks via declared permitted-intents and permitted-delegates.Tier 4: Autonomous (Scalable) Hardened runtime controls enabled across the mesh, including Dynamic Client Registration (DCR) andContinuous Access Evaluation (CAE) for real-time token revocation upon anomalous semantic drift or policy violations.Wrapping UpFrameworks do not secure systems; software secures systems. Google’s Secure AI Framework (SAIF) provides the necessary taxonomy for reasoning about machine learning risks, but enterprise security is ultimately defined by execution boundaries.Attempting to enforce security invariants through natural language prompts is an architectural smell. By moving authorization, metrology, and egress filtering out of the context window and into an out-of-band runtime kernel, engineering teams transform SAIF from an abstract compliance manual into active, auditable, verifiable infrastructure.To explore the open specifications, inspect reference implementations, and run the command-line tooling, review the project documentation at mandrelproject.ai and the open repositories hosted on GitLab, including the Mandrel Spec, the Mandrel CLI, and the Collet Proxy.About the AuthorI have spent 35 years as a software engineer and enterprise cloud architect, and I consult through Barefoot Coders on AI production architecture, runtime governance, and risk mitigation. Most of that work centers on healthcare, life sciences, and financial services, where operational systems must hold up under rigorous audit rather than merely pass an executive demo. That requirement produced the Mandrel Project, an open specification and runtime enforcement engine for autonomous agent meshes, developed openly on GitLab with an Apache 2.0 core. I completed MIT CSAIL’s AI and Business Strategy program, which refined my vocabulary for aligning executive capital allocation with technical systems constraints. I advise CxO leadership and principal architects on decoupling enterprise security policies from probabilistic model weights, evaluating agentic mesh safety, and deploying high-assurance runtime infrastructure.Prose and research assisted by Gemini. Ideas by humans.Enforcing SAIF at Runtime was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.