Skip to content

proof(lean4): mechanize Sandbox Isolation (Theorem 1) - #41

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/gifted-fermat-EmVcv
Jun 14, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
claude/gifted-fermat-EmVcv

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

What

Next item in the phronesis proof scope (after the merged type-safety work #40): mechanizes Sandbox Isolation — promoting docs/safety_proofs.md Theorem 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: Eval has no rule for call (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 static containsDangerous check 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 → only propext. No sorryAx.

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

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
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 30 issues detected

Severity Count
🔴 Critical 0
🟠 High 7
🟡 Medium 23
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
hyperpolymath marked this pull request as ready for review June 14, 2026 12:04
@hyperpolymath
hyperpolymath merged commit 7dd9f3a into main Jun 14, 2026
5 checks passed
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