k8e AGENTS.md

Repository guidance for Codex, an AI coding agent, working on K8E, a Kubernetes distribution for running AI agents in isolated environments. It explains the project structure, architecture, key workflows, and build process.

In plain words
What is it for?
Understanding K8E’s components, tracing how sandbox operations work, navigating the Go and Zig code, and building or modifying its server, agent, command-line tools, gateway, and software libraries.
Why use it?
It gives the coding agent the project context needed to make changes in the right places and follow the repository’s design and build conventions.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/xiaods/k8e/agents-md
Clone the repo
git clone --depth 1 https://github.com/xiaods/k8e

Made for: Codex, OpenCode.

Per session 1,691 This file is loaded in full into every session.
When invoked 1,691 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01691 $0.01691
Opus 5 $0.00846 $0.00846
Sonnet 5 $0.00338 $0.00338
Haiku 4.5 $0.00169 $0.00169

Measured 2d ago against content hash 45cb3ad812af, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

k8e AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

AGENTS.md · 142 lines

How it starts

The opening of the file, as written. The whole thing — 142 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md

This file provides guidance to Codex (Codex.ai/code) when working with code in this repository.

Project Overview

K8E is a CNCF-conformant Kubernetes distribution packaged as a single binary under 100MB, purpose-built for secure, isolated AI agent execution at scale. It provides built-in sandbox orchestration (warm pools, session management), a gRPC gateway for sandbox operations, a CLI command group (k8e sandbox) bridging AI agents to sandbox infrastructure, and client SDKs in Python and TypeScript.

Architecture (Big Picture)

The repository is organized as a Zig-based Go project:

.
├── build.zig                      # Zig build definitions (Go compilation, cross-compilation)
├── main.go                        # CLI entry point — registers all commands
├── cmd/                           # Individual command entry points
│   ├── server/                    # Control plane + optional agent
│   ├── agent/                     # Agent-only (kubelet + containerd)
│   ├── kubectl/                   # kubectl wrapper
│   └── sandbox-gateway.go         # Sandbox gRPC gateway (cli/cmds)
├── pkg/
│   ├── cli/cmds/                  # CLI flag definitions + command wiring
│   │   ├── root.go                # App setup, global flags
│   │   ├── server.go              # Server struct + all server flags
│   │   ├── agent.go               # Agent struct + all agent flags
│   │   ├── sandbox.go             # sandbox CLI command group
│   │   └── sandbox_gateway.go     # sandbox-gateway command
│   ├── server/                    # Server daemon orchestration
│   ├── agent/                     # Agent daemon orchestration
│   ├── daemons/                   # Individual daemon implementations
│   ├── sandboxmatrix/             # Core sandbox orchestration
│   │   ├── controller.go          # Warm pool reconciler, session GC
│   │   ├── api/v1alpha1/          # CRD types (SandboxMatrix, SandboxWarmPool, SandboxSession)
│   │   └── grpc/
│   │       ├── server.go          # gRPC SandboxService (create/destroy/exec sessions)
│   │       ├── orchestrator.go    # Orchestration logic (sub-agents, confirm actions)
│   │       └── pb/                # Generated protobuf Go code
│   ├── sandbox/client/           # gRPC client + skill installation
│   │   ├── client.go              # gRPC client with TLS auto-discovery
│   │   └── install.go             # Skill installation for claude code/codex/pi
│   ├── sandboxcli/                # CLI command handlers for k8e sandbox
│   │   ├── commands.go            # 10 sandbox command handlers
│   │   ├── session.go             # Session state persistence + flock locking
│   │   ├── snapshot.go            # Workspace snapshot save/restore
│   │   └── manifest.go            # Declarative workspace manifest
│   ├── sandboxmatrix/grpc/        # gRPC gateway — proxies exec/file ops to sandboxd pods
│   ├── configfilearg/             # Config file argument parsing
│   ├── deploy/                    # Kubernetes manifests and Helm charts
│   ├── apis/                      # Internal API types
│   ├── bootstrap/                 # Cluster bootstrap (token generation)
│   ├── token/                     # Token management
│   └── ...                        # certmonitor, secretsencrypt, cgroups, vpn, etc.
├── proto/sandbox/v1/              # Protobuf definitions for sandbox gRPC service
├── sandbox/                       # Sandbox container runtime shim (sandboxd)
├── sandboxd/                      # Runtime daemon in Zig (exec, files, networking)
│── pkg/sandboxcli/skills/k8e-sandbox/  # Embedded SKILL.md (installed via connect)
└── tests/unit.go                  # Test helper utilities

Read the full file on GitHub · 142 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 142 lines · 1,691 tokens per session scan A 45cb3ad812af

Subscribe to this mod's changes

k8e AGENTS.md is an instructions file published in the GitHub repository xiaods/k8e (481 stars, last pushed 7d ago), licensed Apache-2.0. It adds 1,691 tokens to every session, about $0.0085 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.