← Back to Pull requests

examples: an agent in a sandbox, a network the admin controls (recorded demo) #535

Closed
unknown closed this pull request without merging on Sep 27, 2026 19:38 UTC
View on GitHub
unknown unknown commented on Sep 27, 2026 18:32 UTC
Author

A recorded, reproducible demo for the story: agentic applications are not deterministic and security wants them sandboxed; developers still need a model, tools and an internal API; a VPN is slow and turns the sandbox into a door with credentials inside. The mesh gives the agent one identity and one policy instead.

What is in it

development/examples/sandboxed-agent/

  • policy.json: role agent may call inference://office-llm, mcp://tools and egress://api.github.com, the last only GET under /repos/google/sam/; the destination is served by nodes labelled site=office with credential github-ro.

  • pep.yaml: the office node (label site=office) fronting Ollama and the MCP reference server on loopback.

  • agent.py: a Python SDK program; enrolls with a single-use token for role agent, then models, chat completion, MCP tool, and three GitHub requests of which the policy allows one.

  • Makefile: ollama, mcp, mesh (sam-one with a Cloudflare quick tunnel and the seed policy, no standing join token), tokens, pep, policy, revoke, ban.

  • audit.py: the node's log as an admin reads it: what it serves and one line per decision.

  • record.sh: tmux window (office panes, a shell in a codespace, a caption line), scenes typed at human pace and paced on real output, asciinema capture, agg/ffmpeg render, srt with the narration.

  • SCRIPT.md: scenes, commands and narration.
  • site/content/docs/use-cases/sandboxed-agent.md embeds the video (site/static/demo-sandboxed-agent.mp4, 2:41, 0.9 MB) and explains the pieces.

    A fix the demo surfaced

    sam-one --policy-file stored the seed's roles and bindings and silently dropped its egress section (SaveMeshPolicy where POST /policies uses SavePolicyDocument). A first boot that named a destination never served it. Fixed, and pinned by TestStandalonePolicyFileSeedsEgress, which fails on the old code.

    Verified

    The recording is a real run: sam-one on this workstation behind a quick tunnel, the office node with a read-only GitHub token, the agent in a GitHub codespace. The final frame shows every scene: Could not resolve host from the sandbox, the banner, tokens, the policy, Serving egress://api.github.com, the model's answer, The sum of 2 and 3 is 5., 200 #534 … from GitHub, two 403 http_request_denied, Withdrawn, 404 Service not found, BANNED, cut off from the mesh. No token appears in the cast (the admin token comes from the environment, so the banner names its source).

    Not shown but noted in the page: grants live in a member's credential until refresh (24 h default), so the demo revokes by withdrawing the destination and by banning, both of which take effect at once.

    Diff: 340 lines (+255 / -85) across 4 files Reviewer: aojea Review duration: 66m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.47 · 340 lines diff across 4 files
    0.47
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.349
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #535"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 47.3% (MEDIUM) · Higher = larger blast radius
    47.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 18.7% · Safe to merge
    18.7%