Seccomp is a Linux kernel mechanism that enforces the Principle of Least Privilege on a per-process basis by filtering system calls. A process transitions into a secure computing mode where its ability to interact with the kernel is limited to a strict, predefined allowlist of syscalls (e.g., read, write, exit). This drastically reduces the attack surface, as even if the process is compromised, the attacker cannot execute powerful syscalls like execve or socket. It is a foundational sandboxing technique for container runtimes and high-security applications.
Glossary
Seccomp

What is Seccomp?
Seccomp (secure computing mode) is a Linux kernel security feature that restricts the system calls a process is permitted to make, effectively sandboxing it to a defined subset of the kernel's interface.
Seccomp operates via BPF (Berkeley Packet Filter) programs that evaluate each syscall attempt. Developers define filters using the seccomp() syscall or higher-level libraries like libseccomp. Seccomp-bpf (the most common mode) allows for sophisticated filtering based on syscall number and arguments. While powerful, it complements other Linux Security Modules (LSM) like SELinux and AppArmor, which enforce file and network access controls. For Secure Enclave Execution, Seccomp is a critical software-based isolation layer, often used in conjunction with namespaces and cgroups to create robust container security boundaries.
Key Features and Modes
Seccomp operates through two primary modes: a strict filter and a configurable filter. These modes define the granularity of control over a process's system call interface.
Seccomp Strict Mode (SECCOMP_MODE_STRICT)
The original and most restrictive mode, introduced in Linux 2.6.12. In this mode, the process is only permitted to make four essential system calls: read, write, _exit, and sigreturn. Any attempt to call another system call results in the termination of the process via a SIGKILL signal.
- Purpose: Provides a simple, absolute sandbox for highly trusted code that requires minimal kernel interaction.
- Limitation: Its inflexibility makes it unsuitable for most real-world applications, which led to the development of the filter mode.
Seccomp Filter Mode (SECCOMP_MODE_FILTER)
The modern, programmable mode introduced via the seccomp() syscall with the SECCOMP_SET_MODE_FILTER flag and the prctl() syscall with PR_SET_SECCOMP. It allows the definition of custom filter programs using Berkeley Packet Filter (BPF) rules to allow, log, or kill specific system calls.
- BPF Programs: Filters are small programs that inspect each system call number and arguments, returning an action (e.g.,
ALLOW,ERRNO,KILL,TRAP,LOG). - Flexibility: Enables fine-grained policies, such as allowing
open()but only for specific file paths or with certain flags.
Filter Actions and Return Values
A BPF filter returns a 32-bit value that dictates the kernel's action for the intercepted system call. The high 16 bits specify the action, and the low 16 bits are action-specific data.
- SECCOMP_RET_ALLOW: The system call executes normally.
- SECCOMP_RET_ERRNO: Blocks the call; the low 16 bits are returned as the
errnovalue to the process. - SECCOMP_RET_KILL: Terminates the process immediately with a
SIGSYSsignal. - SECCOMP_RET_TRAP: Sends a
SIGSYSsignal to the process, allowing it to catch and handle the violation. - SECCOMP_RET_LOG: Allows the call but logs it for auditing. Used when monitoring is more important than blocking.
- SECCOMP_RET_TRACE: Delegates the decision to a ptrace tracer, if present.
Seccomp-BPF: The Filtering Mechanism
Seccomp Filter mode leverages a restricted, in-kernel virtual machine originally designed for network packet filtering: the Berkeley Packet Filter (BPF). A seccomp-BPF program is loaded into the kernel, where it safely evaluates each system call.
- Safety: BPF programs are guaranteed to terminate and cannot perform loops or access arbitrary kernel memory.
- Inspection Capabilities: The program can examine the system call number, architecture identifier, and up to six 64-bit arguments. This allows for argument-based filtering (e.g., checking the
protargument ofmmap). - Program Structure: Typically written using helper macros from
<linux/seccomp.h>and<linux/filter.h>or via libraries likelibseccomp.
Seccomp Notify and Supervisor Model
Introduced in Linux 5.0, the SECCOMP_RET_USER_NOTIF action enables a supervisor process to handle system call violations on behalf of a sandboxed process (the target).
- Mechanism: When a filtered syscall is encountered, the kernel notifies a userspace supervisor via a file descriptor. The supervisor can inspect the call, modify its arguments or return value, and instruct the kernel to proceed or fail it.
- Use Case: Enables complex security policies that require runtime context unavailable to the static BPF filter, such as dynamic pathname resolution or user-based access decisions.
- Tooling: Used by sandboxes like Landlock and systemd-service managers to implement advanced confinement policies.
How Seccomp Works
Seccomp (secure computing mode) is a Linux kernel security feature that restricts the system calls a process is permitted to make, effectively sandboxing it to a defined subset of the kernel's interface.
Seccomp operates by filtering system calls—the fundamental requests a process makes to the Linux kernel for services like file access or network communication. A process can enter a restrictive mode where its permitted syscalls are defined by a Berkeley Packet Filter (BPF) program loaded into the kernel. This filter evaluates each syscall attempt; allowed calls proceed, while blocked ones terminate the process or return an error. This mechanism enforces the principle of least privilege at the most granular OS level.
There are two primary modes: seccomp-bpf, which allows fine-grained, programmable filtering, and the stricter seccomp mode 1, which only permits read(), write(), exit(), and sigreturn(). In modern containerized and secure enclave execution environments, seccomp is a critical layer for sandboxing untrusted code, such as AI agents executing tool calls, by preventing access to dangerous syscalls like execve or ptrace. It is often combined with other Linux Security Modules (LSM) like AppArmor for defense-in-depth.
Frequently Asked Questions
Seccomp (secure computing mode) is a fundamental Linux kernel security feature for sandboxing applications. These questions address its core mechanisms, practical use, and role in securing AI systems.
Seccomp (secure computing mode) is a Linux kernel security feature that restricts the system calls a process is permitted to make, effectively sandboxing it to a defined subset of the kernel's interface. It works by applying a filter policy, written in Berkeley Packet Filter (BPF) bytecode, to the process. When the process attempts to make a system call (e.g., open, write, execve), the kernel evaluates the filter rules. The filter can allow the call, kill the process, return an error, or notify a userspace supervisor via SECCOMP_RET_TRACE. The most restrictive mode, seccomp-bpf, allows fine-grained filtering, while the simpler seccomp-strict mode only permits read, write, _exit, and sigreturn. This mechanism enforces the principle of least privilege at the most fundamental OS level.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Seccomp operates within a broader ecosystem of security technologies designed to isolate and protect processes. These related concepts define the layers of defense and the hardware foundations that complement Seccomp's system call filtering.
Sandboxing
Sandboxing is a general security mechanism for isolating running programs by restricting their access to system resources like the filesystem, network, and other processes. Seccomp is a specific Linux kernel implementation of sandboxing focused on the system call interface. Other sandboxing techniques include:
- Namespaces: Isolate global system resources (e.g., PID, network, mount) for a process.
- Capabilities: Split root privileges into distinct units to limit process power.
- Chroot: Change the apparent root directory for a process, restricting filesystem access. Seccomp provides a stricter, more granular layer of control than these methods by operating at the kernel boundary.
Linux Security Modules (LSM)
Linux Security Modules (LSM) is a framework in the Linux kernel that allows for the implementation of mandatory access control (MAC) security models. While Seccomp filters system calls, LSMs like SELinux and AppArmor enforce policies on how objects (files, sockets, processes) can be accessed by subjects. They operate at a higher level:
- SELinux: Uses labels and complex policies defined by system administrators.
- AppArmor: Uses path-based profiles that are often easier to configure. Seccomp and LSMs are complementary; Seccomp restricts the kernel's entry points (syscalls), while LSMs govern the kernel's internal operations once a syscall is allowed.
Principle of Least Privilege
The Principle of Least Privilege is a foundational computer security concept stating that every user, process, or program should be granted the minimum levels of access—or permissions—necessary to perform its intended function. Seccomp is a direct technical enforcement of this principle at the kernel interface. By defining a strict allowlist of permitted system calls, developers can ensure an AI agent or any process cannot perform privileged operations outside its narrow task, such as arbitrarily spawning processes (fork, execve) or modifying kernel modules. This drastically reduces the attack surface.
eBPF (Extended Berkeley Packet Filter)
Extended Berkeley Packet Filter (eBPF) is a technology in the Linux kernel that allows sandboxed programs to run in a privileged kernel context. While both eBPF and Seccomp are used for security and observability, they serve different purposes:
- Seccomp: Restricts which syscalls a process can make.
- eBPF: Allows safe, dynamic extension of kernel functionality for networking, tracing, and security monitoring. Notably, eBPF programs can be used to implement sophisticated Seccomp-BPF filters, where the filtering logic is defined using a BPF program, offering more dynamic control than a simple static allowlist.
WebAssembly System Interface (WASI)
The WebAssembly System Interface (WASI) is a modular, capability-based system interface for WebAssembly (Wasm) runtimes. It provides a sandboxed set of APIs for securely accessing operating system features like files and networks. WASI and Seccomp share the goal of isolation:
- WASI: Defines a portable, high-level API for Wasm modules. The host runtime (e.g., Wasmtime) is responsible for safely implementing these APIs, often using Seccomp and other OS features underneath.
- Seccomp: A lower-level Linux kernel feature that enforces isolation by filtering the raw syscalls a process can make. In an AI agent context, tool execution could be compiled to Wasm and run in a WASI runtime, which itself may use Seccomp for an additional layer of kernel-level containment.
Trusted Execution Environment (TEE)
A Trusted Execution Environment (TEE) is a secure area of a main processor that guarantees code and data loaded inside are protected with respect to confidentiality and integrity. Technologies include Intel SGX, AMD SEV, and ARM TrustZone. TEEs and Seccomp operate at different layers:
- TEE (Hardware): Provides cryptographic isolation and memory encryption, protecting against a compromised host OS or hypervisor.
- Seccomp (OS Kernel): Protects the host kernel from a malicious or compromised user-space process. For maximum security in AI agent tool execution, a sensitive function could run inside a hardware TEE, and the TEE's runtime itself could employ Seccomp to further restrict its own syscall surface.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us