CLRK: Open-Source AI Agent Runtime with gVisor and MitM Guardrails
Score
70将 gVisor 与 MitM 结合用于 Agent 运行时是较新的思路,信息增量高
内容清晰,但项目尚处早期,文档和示例有待丰富
对于需要在 Kubernetes 上部署安全 Agent 的团队具有直接参考价值
近期登上 Hacker News 热门,反映当下 AI Agent 安全热点
Hacker News 社区讨论与 GitHub 开源仓库可交叉验证,信源可信
Base 77.5 × T2 Source weight ×0.9 = 70
Curation line 70Selected
Why selected
Novel combination of security sandboxing and agent communication control fills a gap in open-source secure agent runtimes.
AI commentary
「Although still early-stage, this project has a very pragmatic design—many teams struggle with security when deploying AI agents, and CLRK directly addresses it with gVisor for process isolation and MitM for communication auditing. Worth watching for DevOps and security teams running agents on Kubernetes.」
Quick overview
CLRK (Cognitive Loop Runtime for Kubernetes) is an open-source AI Agent runtime that leverages gVisor sandboxing and MitM (Man-in-the-Middle) guardrails to provide secure isolation and trusted execution for agents in Kubernetes environments. Open-sourced on GitHub, it supports cognitive loop architecture, suitable for high-security automated agent deployments.
- Lightweight sandbox isolation via gVisor enhances agent runtime security
- Built-in Man-in-the-Middle (MitM) guardrail layer monitors and filters agent communications
- Designed natively for Kubernetes with cognitive loop architecture support
Full text
Showing the source text; the full translation is being generated.
CLRK
CLRK (we pronounce it as "clerk") is a Kubernetes-native runtime for LLM agents. It runs each agent in a gVisor sandbox and transparently intercepts all egress - LLM APIs, MCP, tool calls - without modifying agent code. That interception point gives you observability, policy enforcement, and routing-based cost control over agents you don't otherwise get to see inside.
How it works
CLRK runs untrusted, framework-agnostic agent workloads in gVisor sandboxes. You describe an agent declaratively - a container image + a trigger + an egress policy - and CLRK schedules it onto a pool of sandbox workers. It brings its own scheduler, so agent startup isn't gated on pod-creation latency. Every byte in or out of the sandbox passes through a transparent proxy CLRK controls, so the platform sees and governs all LLM API calls, MCP traffic, and outbound tool calls without the agent code being aware of it. Yes, that includes TLS-encrypted connections.
The agent inside can be anything that makes HTTP(S) calls - a Python script using the OpenAI or
Anthropic SDK, a Node MCP client, a shell one-liner. There is no required agent library; CLRK
intercepts at the network and process boundary. See _examples/ for runnable agents
(openai-bot, gemini-bot, cron-bot, jq-bot, MITM variants, and more).
Motivation
Running agents in production raises problems that general-purpose container orchestration does not solve on its own. CLRK is built to address them directly:
- Observability. All I/O in and out of a sandbox is intercepted and logged, so LLM, MCP, and remote tool-call telemetry is auto-instrumented rather than bolted on per-framework.
- Governance. Prevent sandbox escape and apply organization-wide policy (where an agent may connect, what credentials it may use) at the egress boundary.
- Attribution. Tie agent loops back to the customer request or trigger that
started them, captured as first-class
Invocationrecords. - Zero-Trust Access. Give agents audited, authorized access to internal services instead of all-or-nothing network access.
- Scalability. One model for both serverless bursts and long-lived "on-prem" Kubernetes fleets.
- Reliability. Simple, robust retries, load-shedding, all outside of the Kubernetes control plane.
A deliberate design choice that follows from governance: credentials never live in the agent. API keys for AI providers, MCP servers, and internal services are injected by the egress MITM at request time, never via pod env, mounts, or args - so a compromised sandbox cannot exfiltrate them.
Architecture
CLRK ships two long-running binaries plus a CLI:
-
cmd/controller-manager- the control plane. Runs the controller-runtime reconcilers for the CRDs below and embeds an aggregated API server for theclrk.apoxy.devgroup. Deployed as a Deployment on Kubernetes but can be run standalone. It also hosts UI dashboard. -
cmd/worker- Manages sandbox lifecycle via gVisor/runsc, sets up per-sandbox network interception via our custom sentrystack plugin to be routed through the interception path. Linux-only (//go:build linux, CGO). -
cmd/clrk- the operator/developer CLI:install,upgrade,dev,apply,get,logs,traces,status,run-task, context management, and a local-cluster dev loop.
Egress interception. Outbound traffic is captured transparently and sent through
an EgressGateway - an Envoy-based data plane with TLS termination (MITM) and a
custom filter. This is where telemetry is recorded, credentials are injected,
and routing/governance policies (EgressL4Route, MCPRoute, AIProviderRoute,
egress/credential/fallback-routing/logging/rate-limit policies) are applied.
Telemetry storage and export. Intercepted I/O becomes Invocation records
backed by ClickHouse (via the ch-go driver) and can be consumed using /logs and
/traces subresources as well as re-exported over OpenTelemetry sink.
TaskAgent vs DaemonAgent
TaskAgent is for triggered, run-to-completion work (HTTP request or cron) multiplexed
across shared worker pods. DaemonAgent is for long-lived agent processes with a
restart policy.
APIs
| CRD | Purpose |
|---|---|
TaskAgent |
Short-lived agent execution (request → sandbox → response) |
DaemonAgent |
Long-lived agent process with restart policy |
WorkerPool |
Fleet of worker pods (Deployment + Service) |
EgressGateway |
Transparent egress proxy with TLS termination modes |
EgressL4Route |
L4 egress routing rules |
MCPRoute |
MCP protocol routing |
AIProviderRoute |
AI-provider-specific egress routing |
Invocation |
Attributed record of an intercepted agent call (ClickHouse-backed) |
Repository layout
| Path | Contents |
|---|---|
api/clrk/v1alpha1/ |
CRD types (Apache-2.0) |
client/ |
Generated Kubernetes clientset, listers, informers (Apache-2.0) |
internal/controller/ |
controller-runtime reconcilers |
internal/worker/, internal/sandbox/ |
sandbox lifecycle (Linux-only) |
internal/eg*, internal/extproc/, internal/egress/ |
Envoy egress data plane + interception |
internal/clickhouse/, internal/chwriter/, internal/otel* |
telemetry storage and export |
internal/install/, cmd/clrk/ |
installer and CLI |
codegen/ |
code-generator config (update.sh, header boilerplate) |
FAQ
Does my agent need to use a specific framework or SDK?
No. CLRK intercepts at the network and process boundary, so any agent that makes HTTP/S calls works. The provided examples use the OpenAI and Gemini SDKs, plain shell tools, and MCP clients.
Where do API keys live?
Not in the agent. Credentials are injected by the egress MITM at request time via a credential-injection policy - never in pod env, mounts, or args. A compromised sandbox has no secrets to leak. The secret material iself is safe and sound in a Kubernetes Secret.
How is the sandbox isolated?
Sandboxes run via gVisor (runsc) for a stronger syscall
boundary, each in its own network namespace with all egress forced through the
interception path.
Can I run it locally or do I need a Kubernetes cluster?
All batteries included! clrk dev brings up a local cluster and dev loop. This can
also be used to run CLRK without a Kubernetes cluster nearby. clrk install /
clrk upgrade manage a Kubernetes-based deployment.
Why are api/ and client/ licensed differently from the rest?
So you can build against the API and use the generated client without AGPL copyleft obligations. See License.
Where is CONTRIBUTING.md?
Currently, external contributions are not accepted. If you encounter a bug or have a feature request, please open an issue on the GitHub repository.
Was this tested? I can't find any tests!
We have tests, we swear! Currently they are coupled with our private build/test infrastructure and are not publicly available. We try to maintain minimum 70% unit test coverage and have integration tests for the public API.
Was this vibe-coded?
We rely on AI-assist but every output line is carefully reviewed and tested before being committed.
License
CLRK is licensed under the GNU Affero General Public License v3.0
(AGPL-3.0); see LICENSE.
Exception: the api/ and client/ directories are
licensed under the Apache License 2.0; see api/LICENSE
and client/LICENSE. These cover the public API types
(api/clrk/v1alpha1) and the generated Kubernetes client/SDK, so they can be
imported and used without AGPL copyleft obligations.
Related items
92
FeaturedOpenRouter Launches Prompt Caching with Sticky Routing to Drastically Reduce Multi-Turn Costs
OpenRouter 推出提示缓存与粘性路由,大幅降低多轮对话成本
For developers making frequent AI API calls, this feature is a direct money-saver. Sticky routing guarantees cache hit rates, and session_id requires zero configuration—every OpenRouter user should try it immediately.
91
FeaturedChatGPT Work: An AI Agent That Takes Action Across Apps and Files
ChatGPT Work:可在跨应用和文件中执行操作的AI Agent
I think this is a key step for AI assistants moving from Q&A to execution. Especially noteworthy for professionals who need to automate complex workflows. ChatGPT Work could become a new paradigm for productivity tools.
90
FeaturedAnatomy of a Frontier Lab Agent Intrusion: A Technical Timeline of the July 2026 Incident
前沿实验室代理入侵事件技术时间线:2026年7月事件剖析
This technical timeline is a must-read for all AI security researchers and agent developers—it doesn't just describe one attack but sounds an alarm on the weak defense systems of agent architectures. For teams deploying autonomous agents, this is an essential disaster prevention manual.
90
FeaturedBetter Tools Made Copilot Code Review Worse? Here's How GitHub Improved It
更好的工具反而让Copilot代码审查更糟?GitHub这样改进
This blog post deserves close reading by all AI product engineers and ML practitioners—it breaks the intuition that 'more powerful tools = better AI' and instead emphasizes an engineering philosophy aligned with agent reasoning patterns. Especially important for teams optimizing code review or similar agent-based products.
88
FeaturedOpenRouter Launches Unified Multimodal API: Single Endpoint for Image, Video, Audio, Embeddings, and Transcription
OpenRouter 推出统一多模态 API:单端点支持图像、视频、音频、嵌入与转录
This news is worth attention from all developers building multimodal AI applications: OpenRouter's unified API solves the pain of model switching, especially for startups or rapid prototyping. If you're struggling with multiple API keys and SDKs, this interface could be the unified layer you need.
87
FeaturedAnthropic Launches Claude for Teachers: AI Tools Designed for Educators
Anthropic 推出 Claude for Teachers:面向教师的教育 AI 工具
This announcement is valuable for educators and AI industry watchers alike. Instead of a generic chatbot, Anthropic designed a safety-first tool specifically for teachers, demonstrating the right approach for AI vertical deployment: solving real pain points rather than showing off technology. The built-in guardrails also set a reference for other AI companies, especially when serving scenarios involving children or teenagers.
86
FeaturedOpenRouter Introduces New Auto Router: Model Routing Powered by Market Wisdom
OpenRouter发布全新Auto Router:用市场智慧优化模型路由
This update is worth attention for anyone using APIs to build AI apps. Instead of guessing or testing model selection, market data now does the heavy lifting. Though sparse on details, the direction is right, especially for teams relying on aggregated model services.
86
FeaturedClaude Code v2.1.211 Release: Multiple Fixes and Improvements
Claude Code v2.1.211 发布:多项修复与改进
As a developer who frequently uses Claude Code for automated coding, I'm particularly interested in the security fixes, especially the permission preview character bypass and auto mode overriding hook decisions—these directly affect the security boundaries during team collaboration. The improvement in background agent reporting also makes long-running tasks more reliable. I recommend all users upgrade as soon as possible.