proof(lean4): mechanize Sandbox Isolation (Theorem 1) - #41
Merged
Merged
Conversation
Promotes the sandbox guarantee from a paper proof to machine-checked Lean,
on core Lean (no deps):
* sandbox_no_call_executes : the evaluator is INCAPABLE of executing an
external call -- Eval has no rule for `call` (the only constructor that
could reach a host/module operation), so policy evaluation performs no
external effect. The core "no I/O escape" guarantee in the pure model.
* callNames / callNamesArgs : the function names a policy would invoke.
* sandbox_clean / sandbox_cleanArgs : the static containsDangerous check is
SOUND -- a statically-clean policy invokes no dangerous function
(mechanises Theorem 1.1). Mutual structural recursion over the AST.
Verified: lake build OK; #print axioms shows sandbox_no_call_executes has no
axioms, sandbox_clean/Args only propext -- no sorryAx.
https://claude.ai/code/session_01DQACj3RFmAPZaBPgR9SAaS
🔍 Hypatia Security ScanFindings: 30 issues detected
View findings[
{
"reason": "Action trufflesecurity/trufflehog@main needs attention",
"type": "unpinned_action",
"file": "secret-scanner.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in secret-scanner.yml",
"type": "missing_timeout_minutes",
"file": "secret-scanner.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in scorecard-enforcer.yml",
"type": "scorecard_publish_with_run_step",
"file": "scorecard-enforcer.yml",
"action": "split_scorecard_publish_job",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "binary_to_term without :safe option -- deserialization attack (1 occurrences, CWE-502)",
"type": "elixir_send_unsanitised",
"file": "/home/runner/work/phronesis/phronesis/lib/phronesis/compiler.ex",
"action": "flag",
"rule_module": "code_safety",
"severity": "high"
},
{
"reason": "Nominal-only SAST in phronesis: codeql.yml language matrix contains no language present in the repo and lacks `actions`, so CodeQL records zero results on every commit. Remediation: set the CodeQL matrix to `language: actions`.",
"type": "StaticAnalysis",
"file": "/home/runner/work/phronesis/phronesis",
"action": "auto_fix",
"rule_module": "scorecard",
"severity": "medium",
"remediation": "Add CodeQL or equivalent SAST workflow.",
"scorecard_check": "SAST"
},
{
"reason": "Repository has 3 non-main remote branch(es). Policy: single main branch only.",
"type": "GS007",
"file": ".",
"action": "delete_remote_branches",
"rule_module": "git_state",
"severity": "medium"
},
{
"reason": "Code scanning (Hypatia): hypatia/structural_drift/SD007 -- Hypatia structural_drift: SD007 -- 2 day(s) old",
"type": "CSA001",
"file": ".claude/CLAUDE.md",
"action": "review",
"rule_module": "code_scanning_alerts",
"severity": "medium"
},
{
"reason": "Code scanning (Hypatia): hypatia/structural_drift/SD007 -- Hypatia structural_drift: SD007 -- 2 day(s) old",
"type": "CSA001",
"file": ".claude/CLAUDE.md",
"action": "review",
"rule_module": "code_scanning_alerts",
"severity": "medium"
},
{
"reason": "Code scanning (Hypatia): hypatia/structural_drift/SD007 -- Hypatia structural_drift: SD007 -- 2 day(s) old",
"type": "CSA001",
"file": ".claude/CLAUDE.md",
"action": "review",
"rule_module": "code_scanning_alerts",
"severity": "medium"
},
{
"reason": "Code scanning (Hypatia): hypatia/structural_drift/SD007 -- Hypatia structural_drift: SD007 -- 2 day(s) old",
"type": "CSA001",
"file": ".claude/CLAUDE.md",
"action": "review",
"rule_module": "code_scanning_alerts",
"severity": "medium"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
hyperpolymath
marked this pull request as ready for review
June 14, 2026 12:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Next item in the phronesis proof scope (after the merged type-safety work #40): mechanizes Sandbox Isolation — promoting
docs/safety_proofs.mdTheorem 1 from a paper proof to machine-checked Lean (core Lean, no deps).sandbox_no_call_executes— the evaluator is incapable of executing an external call:Evalhas no rule forcall(the only constructor that could reach a host/module operation), so policy evaluation performs no external effect. This is the core "no I/O escape" guarantee in the pure model.callNames/callNamesArgs— the function names a policy would invoke.sandbox_clean/sandbox_cleanArgs— the staticcontainsDangerouscheck is sound: a statically-clean policy invokes no dangerous function (mechanises Theorem 1.1). Mutual structural recursion over the AST.Verification
lake build✓.#print axioms:sandbox_no_call_executes→ no axioms;sandbox_clean/sandbox_cleanArgs→ onlypropext. NosorryAx.Remaining phronesis scope (for context)
Per the agreed order — sandbox ✓ (this PR) → wire TLC + conformance into CI → mechanise Capability Enforcement / BFT → ethics-specific soundness. Items after this are new theory or CI wiring.
🤖 Draft opened by Claude Code.
https://claude.ai/code/session_01DQACj3RFmAPZaBPgR9SAaS
Generated by Claude Code