EXPLAINER17 min read

eBPF Runtime Defense for AI: Lessons From Shirudo

eBPF runtime defense for AI adds a deterministic Linux enforcement layer beneath agents, but it does not replace application policy or careful release controls.

P
PADISO teamPublished 1 Dec 2026

eBPF runtime defense for AI puts security controls inside the Linux kernel, beneath an agent and the tools it starts. Shirudo is a useful architecture to study because it pairs that enforcement point with signed, targeted runtime changes. It is not a replacement for application permissions, container isolation or human approval of security changes.

For a team considering an agent that can run shell commands, edit files or call an MCP server, the practical question is not whether a kernel hook can stop a syscall. It can. The question is how to make the rules narrow, testable and reversible without creating a new source of production risk. Our AI agents and automation service helps teams design those boundaries alongside the agent workflow.

What does eBPF runtime defense for AI mean?

eBPF is a Linux technology that lets approved small programs run at selected points in the kernel. The kernel is the operating system component that manages processes, files, memory and network access. A security program attached to a relevant kernel hook can observe or reject certain actions while they are being attempted, rather than relying only on an application to notice a problem afterwards.

Runtime defense means protection while software is running. In an AI agent environment, that can include limiting which processes the agent can start, which files they can open, or where they can connect. The agent may decide what action to take at runtime, but kernel policy can still enforce a fixed boundary around what the action is allowed to do.

An AI agent is software that can choose and perform steps towards a goal, often by calling tools. A coding agent might inspect a repository, launch a shell, install a package and run tests. An operations agent might query a service, write a report and call an internal API. These actions create a wider and less predictable execution path than a single request to a model.

The Model Context Protocol, or MCP, is a way for an AI application to connect to tools and data sources through a defined interface. MCP can help an application expose capabilities cleanly, but it does not itself guarantee that every tool call is safe. The application should decide what the agent may request; operating system controls should limit what the resulting processes can actually do.

That is the core idea: application policy decides whether an action makes sense in context, while kernel policy enforces a technical limit regardless of the agent's stated intent. eBPF is a Linux-specific part of that design, not a general security layer for every operating system or a magic shield against unsafe model output.

Why are autonomous agents harder to contain than ordinary services?

A conventional service usually follows a relatively stable execution pattern. A web server accepts a request, runs known code and makes calls to a known set of dependencies. An agent can make a new decision at each step. Its process tree may include a command shell, a compiler, a package manager or a helper program selected during the task.

That difference matters because tool permissions accumulate. An agent might need to read a code directory, but not the host's cloud credentials. It might need to run tests, but not launch arbitrary binaries from a temporary directory. It might need access to one internal service, but not unrestricted access to every reachable network address. A broad permission granted for convenience can become a broad permission available to every child process.

The threat does not have to begin with a malicious model. A user can ask for an unsafe action. A retrieved document or web page can contain indirect instructions. A dependency can be compromised. A tool can have a vulnerability. A legitimate agent can also make an incorrect choice. In each case, the security design should assume that the agent may request an action outside its intended scope.

Prompt filters and model-based judges can help assess intent, but they operate at the application layer. They may miss an indirect instruction or misunderstand a request. Even a strong filter cannot, by itself, stop a process that already has operating system permission to read a file or open a socket. This is why agent evaluations beyond vibe checks should be paired with tests of actual tool and host permissions.

Containers also have limits. A container uses Linux features such as namespaces and cgroups to separate processes and manage resources. It shares the host kernel, so a container is not equivalent to a separate physical machine. Its real protection depends on configuration: privileged mode, mounted host paths, exposed sockets and overly broad capabilities can undermine the boundary. Containers remain useful, but they do not automatically make a tool safe.

A micro virtual machine runs a guest operating system using hardware virtualisation. It can offer a stronger isolation boundary than a conventional container, at the cost of a different operational model and possible start-up, memory and integration trade-offs. It may be the right choice when a task handles untrusted code or sensitive data. The choice should follow the threat model, not a claim that one isolation technology fits every workload.

What does Shirudo add to the design?

Cisco and OpenAI described Shirudo as an open-source Linux runtime project for creating and deploying signed runtime protections. Its public materials describe targeted changes called upatches, which can be loaded into a running system to enforce a specific mitigation. The Cisco announcement, Isovalent's architecture overview and Shirudo project repository are the primary places to check the project's current design and release status.

An upatch is a small, targeted runtime change, rather than a full application rebuild or a general-purpose firewall rule set. In the design described by Shirudo, an upatch may use eBPF code to constrain a kernel action, or Java bytecode to guard behaviour within a configured JVM. A Java virtual machine, or JVM, is the runtime that executes Java applications. These are distinct enforcement locations: kernel rules see operating system actions, while JVM instrumentation can see selected Java-level behaviour.

The distinction is important. Kernel-level policy can say that a process in a particular group may not connect to a destination or access a protected path. It generally cannot infer the business purpose of a request. JVM instrumentation may understand a particular runtime operation more closely, but it does not become a universal policy engine for other processes. Each control has a visibility boundary.

Shirudo's design also addresses how a patch is built and authorised. The project materials describe compiling a patch into an executable form, signing it and distributing it as a package through an OCI-compatible registry. OCI means the Open Container Initiative standards used by many container registries and image tools. Using familiar distribution infrastructure can simplify packaging, but it does not make the package safe by itself.

The signing step establishes that an authorised key approved a particular artefact and its metadata. The target can verify that signature before loading the protection. The Linux eBPF verifier checks properties of eBPF programs, including whether they meet kernel rules for safe execution. These checks answer different questions. A valid signature does not prove the patch is correct, and verifier acceptance does not prove the policy blocks the intended attack without blocking legitimate work.

Shirudo describes a target-side trust model that can use a kernel keyring to decide which signatures are accepted. Its materials also describe boot-time setup and TPM-backed measurement. A TPM, or Trusted Platform Module, is a hardware component that can store cryptographic material and record measurements. A PCR, or Platform Configuration Register, is a TPM register that records measurements through a defined extension process. These mechanisms can help an external verifier check what was loaded, but they do not establish that the loaded policy is well designed.

The project's documentation describes a signed loader approach for handling eBPF programs. This matters because loading an eBPF object can involve resolving references and setting up maps, which are data structures shared with the program. A signature over a source file alone would not necessarily represent every detail of the final loaded state. The Shirudo documentation on how the system works explains its proposed process. Treat implementation details as subject to change while the project remains pre-release.

Where should enforcement sit in an agent architecture?

A defensible design uses more than one layer. Each layer should do the job it can perform well and avoid pretending to understand information it cannot see.

Layer What it can decide or enforce What it cannot establish by itself
Agent application and MCP server Which tools are offered, what arguments are permitted, whether a user must approve an action Whether every resulting operating system action stays inside the approved boundary
Identity and service authorisation Which user, agent or service may call a particular API Whether a local process is reading an unrelated file or opening an unexpected socket
Container or microVM Process and resource separation, depending on configuration and isolation type That permissions, mounts and network routes are correctly scoped
eBPF and kernel controls Whether selected process, file or network actions are allowed at the kernel boundary The business meaning or user intent behind an otherwise permitted action
Monitoring and response What happened, whether an alert or containment action is needed Prevention, unless connected to an enforcement mechanism

Consider an agent asked to review a set of application logs. The application can expose a log-search tool with a restricted query interface. The MCP server can authenticate the agent and limit the records it returns. The agent runtime can be placed in a dedicated cgroup, a Linux grouping used to organise processes and apply resource controls. Kernel policy can then restrict that cgroup from reading credential paths or connecting to destinations outside an approved set. Logging can record denied actions and support investigation.

This layered approach avoids a common category error. The kernel can observe that a process tried to open a file. It does not know whether the user's request authorised reading that file. The application can know the request and the data classification, but it may not see every action from a shell process launched by a tool. The application and kernel therefore need separate, explicit responsibilities.

For MCP specifically, define the allowed tool surface first. Name each tool, the data it can access, the action it can take and the identity under which it runs. Then decide what host-level controls are needed if that tool is compromised or misused. Our MCP server development practice focuses on the integration boundary, while kernel enforcement belongs in the platform and operating system design.

How can a team design a useful upatch?

Start with a threat and a protected asset, not with a plan to write eBPF. A narrowly scoped rule that protects a concrete asset is easier to review than a general rule such as block suspicious activity. Write down the attack path in plain language: which process acts, what resource it tries to reach, and what behaviour should remain allowed.

For example, suppose a coding agent needs to run tests in a repository. The asset is a cloud credential file mounted on the host. The unwanted path is an agent child process reading that credential. The desired behaviour is that the agent can still inspect and modify files within its project directory and run approved test commands. A useful policy would distinguish those cases instead of blocking all file access or all child processes.

Then decide the right control point. If the concern is a particular MCP operation, restrict it in the MCP server and require appropriate identity and authorisation. If the concern is a process opening a protected host path, operating system policy may be needed. If the concern is a JVM method or code path, a JVM-level guard may be more precise. Do not force a kernel hook to make a decision that depends on application intent.

A practical design sequence is:

  1. Map the execution tree. Record the agent process, tool processes and expected child processes. Include package managers, shells, compilers and any helper binaries used during normal work.
  2. List required resources. Identify directories, sockets, network destinations and APIs the task needs. Separate required access from access that is merely available today.
  3. Define the deny condition. State what action must fail and under what process or workload identity. Avoid vague labels such as untrusted process unless the label has a reliable technical meaning.
  4. Choose the enforcement layer. Use application checks for intent and tool permissions, and kernel controls for operating system actions. Use both where an attack can cross the boundary.
  5. Build a benign test set. Include normal workflows, unusual but legitimate tasks, error paths and expected child processes. A security rule is not ready just because it blocks a test exploit.
  6. Review the generated artefact. A person with relevant operating system and application knowledge should examine its logic, inputs, scope and failure modes.
  7. Test in observation or non-production mode where possible. Collect what would have been blocked before turning on a hard deny. Check the effect on real workflows and refine the policy.
  8. Release gradually and retain rollback. Deploy to a limited workload first, then expand only after monitoring shows the expected behaviour.

This process is as important as the eBPF program. Kernel code is a high-consequence control point. A small defect can deny a necessary operation to many workloads or leave an unexpected path open. Restricting the patch's scope and release population reduces the impact of that mistake.

What do signatures, the verifier and attestation actually prove?

Security teams should separate provenance, execution safety, policy correctness and runtime state. These are related, but none substitutes for the others.

Provenance answers who approved the artefact and whether it changed after signing. A signature can support that claim when the private key is protected, the verification key is trustworthy and the signed material covers the artefact that is actually loaded. A signature does not prove that the signer understood every consequence of the patch.

Execution safety is the question the eBPF verifier helps answer. The verifier rejects programs that do not meet kernel requirements. This helps prevent classes of unsafe program behaviour, but it does not know that a rule allowing one destination is the intended business policy. Nor does it assess every surrounding operational assumption.

Policy correctness asks whether the rule blocks the intended path while allowing legitimate behaviour. This requires review and testing against both attack cases and normal workflows. A false positive blocks legitimate work. A false negative permits a path that the security team meant to stop. Both deserve explicit tests and an owner.

Runtime state asks whether the intended protection is actually loaded on the host and has not been removed or replaced. TPM measurements and remote attestation can contribute evidence for this question. Attestation is useful only when the verifier knows what measurement to expect, can trust the measurement chain and has a process for responding when a host does not match.

These distinctions inform key management. Keep signing authority separate from the agent that proposes or generates a patch. The agent may prepare a candidate, but it should not be able to approve its own production code or access the signing key. Store signing keys in a controlled service or hardware-backed system where appropriate, limit who can authorise releases and log each approval.

The same principle applies to generated policy. An AI system can help draft a rule or test cases, but an authorised human should own the production decision. That review must include the policy's effect, not just whether the code compiles or passes a verifier. For regulated environments, record the threat, reviewer, test evidence, approval and rollback decision as part of the change record.

How do teams avoid turning a protection into an outage?

Kernel enforcement creates a concentration risk. A policy distributed to a fleet can affect many workloads quickly. A flawed rule may block a shared dependency, a routine process launch or a network path used by a critical service. Faster rollout is valuable only when the release controls are at least as deliberate as the delivery mechanism.

Use a staged release. Begin with a development workload that resembles production. Move to a limited canary, meaning a small, controlled set of production hosts or agent sessions. Observe deny events and service health. Expand only when the policy behaves as expected. Keep a clear mapping between policy versions and the workloads running them.

A safe rollout plan should answer these questions before enforcement:

  • What is the policy's scope: one process, one cgroup, one host class or a wider fleet?
  • Which service owner can approve an expansion to the next group?
  • What signals indicate a legitimate workflow has been blocked?
  • What is the rollback method if the agent or a critical service cannot proceed?
  • Can an operator remove or replace a policy if the control plane or registry is unavailable?
  • How will you investigate a mismatch between the intended and measured runtime state?

Prefer a reversible policy change over a change that depends on rebuilding the agent image or restarting a long-running task, but do not treat zero-restart deployment as an operational guarantee. Whether a particular control can be changed live depends on the implementation, operating system configuration and workload. Verify that behaviour in your own environment before relying on it.

Do not distribute a rule to every host merely because it passed one test. Separate production environments by workload and risk. A coding assistant with access to a test repository may need a different policy from an agent that can initiate payments or query customer records. For financial services, map the control to existing security and change processes, including the requirements that apply to your organisation. Our AI guidance for financial services is a starting point for that wider governance discussion.

Monitoring should cover both successful and denied actions. A stream of denials may show that the guard is doing its job, or that the workload has been misconfigured. Successful actions can also reveal that a permission is broader than the intended task. Capture enough context to investigate, while limiting sensitive information in logs and setting suitable retention and access controls.

What are the limits of eBPF runtime defense?

First, eBPF is not a semantic safety mechanism. It can enforce a destination or process rule, but it generally cannot decide whether a user was entitled to ask the agent to export a particular record. That decision belongs in identity, application authorisation and data governance controls.

Second, it is Linux-specific. If your agent runs across Linux, Windows, macOS and managed cloud services, a kernel eBPF design covers only the applicable Linux hosts. A broader control model must account for the other runtimes and for remote services called by the agent.

Third, eBPF controls depend on kernel capabilities, configuration and the hooks available to the chosen implementation. The team must verify compatibility with its distribution and workload. It should also understand the privileges needed to load and manage programs, and how those privileges are protected from the agent itself.

Fourth, visibility is not the same as prevention. A tracepoint or other observation hook can report that something happened. Synchronous enforcement requires an appropriate enforcement hook and a policy that can make the decision at that point. A design should not describe every eBPF program as a blocking control.

Fifth, kernel-level controls can add overhead and complexity. Avoid broad claims that the overhead is always negligible. Measure the relevant workload, including file-heavy tasks, network calls and process creation, and compare performance with the protection enabled. Keep the measurement method and environment in the release record.

Finally, an eBPF rule cannot fix an exposed credential, an overly broad API permission or a vulnerable MCP server by itself. Reduce the agent's privileges, use short-lived credentials where possible, isolate sensitive data and keep tools narrow. Our platform engineering team can help assess how these controls fit the wider runtime and infrastructure architecture.

How should you evaluate Shirudo before production use?

Treat Shirudo as an architecture and project to evaluate, not as a production recommendation based only on an announcement or demonstration. The repository and documentation should be checked for current release status, supported kernels, installation and upgrade paths, threat model, limitations, maintenance model and known issues. The official repository is the place to verify what is available now; confirm the project's release status again when you conduct your assessment.

A focused proof of concept should use a non-critical Linux workload and a clear containment goal. For example, launch an agent in a dedicated runtime, give it only a test repository, and attempt a defined set of permitted and denied actions. Verify what the kernel sees, what the policy blocks, what gets logged and how an operator removes or updates the protection. Test both routine work and deliberately unsafe actions.

Include the people who will own it after the proof of concept. That usually means platform engineering, security, the agent or application team and an operational owner. Ask who reviews generated patches, who holds signing authority, who handles kernel compatibility and who responds to failed attestation. If those responsibilities are unclear, the gap is architectural, not just a tooling issue.

Evaluation area Evidence to request or produce Decision to make
Compatibility Test results on your Linux distribution, kernel and workload Which hosts are in scope?
Policy quality Positive and negative test cases, reviewed by the workload owner Does it block the attack path without breaking expected work?
Trust and signing Documented key custody, approval and revocation process Who can authorise a production patch?
Operations Rollout, monitoring, rollback and recovery exercise Can the team respond safely when something fails?
Attestation Verification of expected measurements and mismatch handling What does a failed check trigger?
Maintenance Release process, support model and project status Who maintains the integration over time?

The right outcome may be to adopt the pattern without adopting the project. A team can use the same design principles with existing Linux controls, a container or a microVM, depending on its requirements. Tetragon is another eBPF-based security and observability project in the broader ecosystem, but its capabilities and operating model should be assessed separately rather than assumed to match Shirudo.

Where does PADISO fit?

We help teams decide what an agent should be allowed to do, then design the application, MCP and platform controls around that boundary. Our AI automation service and MCP development service cover agent and tool design; platform engineering helps assess the runtime and infrastructure side. Start by listing one real agent workflow, its data and tools, and the actions it must never take. If you are planning an AI deployment and need a structured first assessment, take the PADISO AI readiness test.

WANT TO TALK THROUGH YOUR SITUATION?

Talk it through with us. Thirty minutes, no slides.

P
Written by the PADISO TeamSydney-based technology leaders who build what they advise on. Seven years of fractional CTO, architecture and AI work for enterprise, government and private equity.

Keep reading

All posts →

Let's talk.

Tell us what you are weighing up, whether it is a build, a roadmap or a deal. You will leave the call knowing your next step.

Book a 30-min callhi@padiso.co