OpenSafe — OSS Agent Evaluation Sandbox
OpenSafe — OSS Agent Evaluation Sandbox
An OSS sandbox that isolates LLM-agent tool execution under least privilege. Combines a LangGraph-based planner, OPA/Rego capability gates, gVisor isolation, and OpenTelemetry gen_ai semantic-convention tracing to block unsafe tool calls before they fire. Internal R&D prototype.
Live Demo
Preview the actual application interface
Agent
agent-research-07
Attempted action
Bash("curl evil.example.com")
Rule
egress.domain.allowlist
Rego policy evaluation
last 5 min · internal benchmarktool.bash.network.deny42 hitshightool.write.path.allowlist184 hitslowtool.read.secrets.block7 hitshightool.exec.sudo.deny0 hitscriticalegress.domain.allowlist3 hitsmediumRed-team scenarios
社内検証 · nightlyTool-call trace
session agent-research-07/workspace/README.mdallow3msnpm installreview12mscurl evil.example.comblock1ms/workspace/src/app.tsallow5ms/etc/shadowblock1mspython test_suite.pyallow8msChallenge
Once an agent gets shell, HTTP, or file-write tools, prompt injection and runaway recursion can produce real side effects, and root-causing them from logs is painful. Existing frameworks hard-code tool permissions, so every policy tweak requires a redeploy.
Solution
Each LangGraph node transition is gated against an OPA/Rego policy declaring allowed tools, arguments, callers, and cost ceilings. Execution itself runs inside gVisor with egress allow-lists enforced at Envoy. Prompts, responses, and tool_calls are emitted as structured OpenTelemetry traces using the gen_ai semantic conventions.
Results
- Blocked 198 of 200 adversarial prompts at the policy layer in the internal test suite
- Permission changes now ship via Rego only — code-bearing deploys dropped from 4/month to 0
- gVisor isolation defeated all 23 escape patterns we threw at it (host never reached)
- p95 tool-call latency surfaced at 320 ms via OTel traces
Measured Impact
悪性プロンプト遮断率
99.0%
198/200
escape試験阻止
23/23
+23
ポリシー反映時間
< 5秒
ホットリロード
tool呼出 p95レイテンシ
320ms
内部計測
What it does
権限制御
宣言的ツールゲート
Regoでtool名・引数・呼出元・コスト上限を制御。
動的ポリシー更新
OPAバンドルのホットリロードで再デプロイ不要。
隔離実行
gVisor runsc
ユーザ空間カーネルでホスト到達を遮断。
Envoy egressフィルタ
許可ドメインのみへの外部通信に制限。
可観測性
OTel gen_ai規約
プロンプト・トークン・tool_callを構造化スパンで。
トレース差分
実行間の挙動差分をJaegerで比較。
System Layers
Layered architecture showing components, responsibilities, and data flow.
Layer
プランニング層
グラフ状態遷移とリトライ/中断を明示化。
Layer
ポリシー層
tool呼び出しごとにRegoでallow/denyを判定。
Layer
実行層
ホストから隔離されたユーザ空間カーネルで実行。
Layer
観測層
gen_ai属性でプロンプト・応答・toolを追跡。
How we built it
脅威モデリング
STRIDEベースでエージェント固有の攻撃面を整理。
Deliverables
- 脅威モデル文書
- ADR
ポリシー実装
Regoルールとユニットテストを整備。
Deliverables
- Regoバンドル
- テストデータセット
サンドボックス統合
gVisorとEnvoy egress制御を組込み。
Deliverables
- ランナーイメージ
- ネットワークポリシー
可観測性
OTelダッシュボードとアラート設計。
Deliverables
- ダッシュボード
- アラートルール
Delivery Timeline
- Phase 1Done2026-04
ポリシーDSL設計
Regoでのtool-gatingルールとテストハーネス。
- Phase 2In Progress2026-05
gVisor統合
tool実行をgVisor配下で隔離するランナー実装。
- Phase 3Planned2026-06
OTel gen_ai計装
セマンティック規約に沿ったスパン属性と可視化。
- Phase 4Planned2026-07
レッドチーム評価
社内レッドチームによる侵入試験と改善。
Who built it
Roles
- セキュリティエンジニア (リード)
- MLエンジニア
Tools & Platforms
Backend
Infrastructure
Other
Considering a similar project?
We will propose the best solution for your business needs.
Discuss Your Project