Skip to content

feat(runtime): Phase 2 SDK — IFC, quarantine, policy enforcement, audit chain - #20

Draft
new-world-coder wants to merge 1 commit into
mainfrom
cursor/phase2-runtime-sdk-f5d6
Draft

new-world-coder wants to merge 1 commit into
mainfrom
cursor/phase2-runtime-sdk-f5d6

Conversation

@new-world-coder

Copy link
Copy Markdown
Owner

Summary

Implements Phase 2 — Runtime SDK (@agentshield/runtime Python package) plus Node API mirror.

Python runtime (python/agentshield/runtime/)

  • IFC labels — integrity (trusted/untrusted) + confidentiality (public/private) with merge rules
  • Quarantine store — untrusted content stored as opaque references
  • Runtime policy DSL — YAML extending Phase 1 tool policy with ifc_rules, sensitive_tools, mode
  • RuntimeEnforcer / AgentShieldRuntime — fail-closed production vs development warn modes
  • Audit chain — tamper-evident hash-chained JSONL log

CLI

  • agentshield runtime check — replay execution trace against policy
  • agentshield runtime audit-verify — verify audit chain
  • agentshield runtime policy-ast — compile policy AST stub (future CEL/Rego)

Server API

  • POST /api/runtime/check — trace + policy → enforcement results
  • POST /api/runtime/audit/verify — verify audit entries

Docs & DX

Security behavior

IFC deny rules take precedence over tool-policy require_approval when untrusted content is in scope (blocks rug-pull / injection → sensitive tool paths).

Tests

cd python && pip install -e ".[dev]" && pytest   # 41 passed
cd server && npm ci && npm test -- --config jest.assure.config.js  # 15 passed

Deferred (see docs/PHASE2_GAPS.md)

LangChain/MAF bindings, CEL/Rego compiler, human approval UI, dashboard panel.

Open in Web Open in Cursor 

…it chain

- Add python/agentshield/runtime (labels, context, quarantine, policy DSL,
  enforcer, audit chain, AgentShieldRuntime middleware)
- CLI: runtime check, audit-verify, policy-ast
- Node mirror: /api/runtime/check and /api/runtime/audit/verify
- Examples, tests (41 Python + 15 Node assure/runtime), docs/RUNTIME.md,
  PHASE2_GAPS.md, README contributing section with pinned issues #4-#8
- IFC deny rules take precedence over tool approval when untrusted in scope

Co-authored-by: New World Coder <new-world-coder@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants