{"slug": "multi-layer-policy-for-securing-ai-agents", "title": "Multi-Layer Policy for Securing AI Agents", "summary": "Tigera has introduced a multi-layer policy framework for securing AI agents, requiring policy enforcement at both the gateway and kernel layers rather than a single point. The gateway layer enforces agent intent by controlling which agents can invoke tools or delegate tasks, while the kernel layer constrains agent behavior at the operating system level, such as file access and system calls. By using a single policy language, Cedar, across both enforcement points, the framework aims to close security gaps that arise when policy is applied at only one layer.", "body_md": "As part of our work at Tigera building products that create secure runtime environments for enterprise agents at scale in the real world, one small part of this puzzle I think about a lot is policy, and runtime enforcement of policy, and how to create a comprehensive secure runtime, configured from one place. The more companies we talk to trying to lock down and secure these platforms at runtime, the more I believe [AI Agent security](https://www.tigera.io/learn/guides/ai-agent-security/) needs policy in multiple places, not just one (e.g., not just at the gateway layer), and ideally expressed in the same policy language.\n\nAt the L7 gateway layer, every agent call is observable: who is calling, what they are calling, what attributes both sides carry, what the requested action is. This is where you decide whether an agent should be permitted to talk to a particular MCP server, invoke a particular tool, delegate to another agent, or call a particular LLM. The atoms of policy here are identity, action, resource, and context.\n\nAt the agent runtime layer, or kernel layer in a container, what the agent does inside its own runtime is observable: syscalls, file access, library loads, network connections that bypass the brokered channel. This is where you decide whether the agent can read a file, open a socket, spawn a subprocess, or load a library. The atoms of policy here are processes, paths, file descriptors, and system calls.\n\nBoth layers are necessary. The gateway alone cannot constrain what an agent does inside its runtime once it holds a token. The kernel alone cannot reason about identity, delegation, or multi-hop intent. Building policy at one and not the other leaves a category gap.\n\nThe architectural choice that makes this work in practice is using one policy language for both. We use Cedar at the gateway and interpret and translate Cedar to [eBPF](https://docs.tigera.io/calico/latest/about/kubernetes-training/about-ebpf) policy for the kernel: same policies, two enforcement points, one place to author and review.\n\n## Policy at the gateway: enforcing agent intent\n\nThe gateway sees intent. It is the right place to enforce *who can talk to whom, under what conditions, with what level of human oversight.*\n\nA Cedar policy that constrains which agents can invoke which tools:\n\n```\npermit (\n  principal in Group::\"finance-agents\",\n  action == Action::\"invokeTool\",\n  resource in ToolSet::\"finance-readonly\"\n) when {\n  principal.risk_level == \"low\" &&\n  context.delegation_depth <= 3\n};\n```\n\nThis policy expresses several things that are hard to model in RBAC or in a network policy. The principal is identified by group membership but constrained by attribute (`risk_level`\n\n). The resource is a typed set of tools. The condition includes a check on delegation depth; agents three hops deep in a delegation chain are refused even if they pass every other check.\n\nThe gateway layer naturally enforces delegation rules, per-hop token issuance with scope reduction, agent-to-MCP tool authorization, agent-to-LLM constraints, human-in-the-loop hooks for high-stakes actions, and attribute-based decisions across all of these.\n\nWhat the gateway cannot do is constrain what happens after it issues a token. Once the agent has the credential, the kernel is the only layer that sees what the process actually does with it.\n\n## Policy at the kernel: constraining agent behaviour\n\nThe kernel sees behaviour. It is the right place to enforce *what an agent process is allowed to do at the operating system level*, regardless of what tokens it holds.\n\nA baseline sandbox for an agent workload, expressed conceptually in the same Cedar policy model and compiled to BPF programs at runtime:\n\n```\npermit (\n  principal in AgentClass::\"data-analyst\",\n  action in [Action::\"readFile\", Action::\"writeFile\"],\n  resource is FilePath\n) when {\n  resource.path like \"/workspace/analyst-*\" ||\n  resource.path == \"/var/run/secrets/analyst-key\"\n};\nforbid (\n  principal in AgentClass::\"data-analyst\",\n  action == Action::\"connectNetwork\",\n  resource is NetworkDestination\n) unless {\n  resource.host in DestinationSet::\"approved-llm-endpoints\" ||\n  resource.host == \"lynx-gateway.internal\"\n};\n```\n\nThe compilation target is BPF LSM hooks, cgroup network hooks, and file access enforcement at the inode boundary. When the agent process steps outside what the policy permits, the kernel refuses the operation – `EPERM`\n\nfor the syscall, `ECONNREFUSED`\n\nfor the network connection, `ENOENT`\n\nfor the file access. The agent gets the same error it would get for any prohibited operation, regardless of what credentials it holds.\n\nThe kernel layer naturally enforces file access boundaries, network egress restrictions, syscall whitelisting, library load constraints, and process-spawn limits. The same observation pipeline that feeds enforcement also feeds threat detection.\n\nWhat the kernel cannot do is reason about why an action is being attempted. It sees a `connect()`\n\nsystem call. It does not know whether the call is part of a legitimate multi-hop delegation that the gateway already authorized. That context only exists at the L7 layer.\n\n## The dual-layer architecture\n\nThe architectural integration matters as much as either layer in isolation. Cedar policies authored once, evaluated at the gateway, compiled to BPF for kernel enforcement. The compilation is not magical—only the substrate-relevant subset of Cedar policies compiles. The rest stay at the gateway. Either way, security teams write Cedar; the runtime decides which layer is the right one to enforce at.\n\nThis integration is what makes the dual-layer approach operationally sustainable. Without one policy language, you end up with two policy stores, two review processes, two engineering teams, and inevitable divergence between what the gateway permits and what the kernel allows. With Cedar at both layers, the policy you wrote is the policy that gets enforced everywhere.\n\n## Why single-layer policy isn’t enough for AI agent security\n\nPolicy at the gateway alone defends against unauthorized callers and out-of-scope actions. It does not defend against a compromised agent that has a legitimate token and uses it to do things outside its intended behaviour, like read credential files, exfiltrate data through side channels, and escalate privilege inside its runtime.\n\nPolicy at the kernel alone defends against process-level misbehaviour. It does not understand identity or delegation, cannot reason about whether a network connection is part of a legitimate multi-hop chain, and has no way to enforce human-in-the-loop approval flows.\n\nCombined, the two layers cover the threat model that either layer alone misses. A compromised agent with a legitimate token can still call out through the gateway, but its local actions are constrained by the kernel sandbox. A misconfigured Cedar policy at the gateway is mitigated by the substrate baseline. A shadow agent that never registered is observed and contained at the kernel.\n\nFor Kubernetes-native enterprises building agent infrastructure into regulated workloads, this is the architecture worth building toward. Gateway policy for what agents are allowed to ask for. Kernel policy for what they are allowed to do. Same language for both.\n\n## Going deeper\n\nMulti-layer policy is one piece of a larger problem: making AI agent infrastructure accountable end-to-end. Traceability, authorization provenance, identity and ownership, policy-based governance at scale, and human oversight and intervention—they all have to work together.", "url": "https://wpnews.pro/news/multi-layer-policy-for-securing-ai-agents", "canonical_source": "https://www.tigera.io/blog/multi-layer-policy-for-securing-ai-agents/", "published_at": "2026-06-03 18:58:09+00:00", "updated_at": "2026-06-03 19:57:50.784829+00:00", "lang": "en", "topics": ["ai-agents", "ai-policy", "ai-safety", "ai-infrastructure", "artificial-intelligence"], "entities": ["Tigera"], "alternates": {"html": "https://wpnews.pro/news/multi-layer-policy-for-securing-ai-agents", "markdown": "https://wpnews.pro/news/multi-layer-policy-for-securing-ai-agents.md", "text": "https://wpnews.pro/news/multi-layer-policy-for-securing-ai-agents.txt", "jsonld": "https://wpnews.pro/news/multi-layer-policy-for-securing-ai-agents.jsonld"}}