Skip to content

feat: enforce execution.{timeout_seconds, require_approval, sandbox}#11

Merged
ancongui merged 2 commits into
mainfrom
feat/enforce-execution-config
Jun 25, 2026
Merged

feat: enforce execution.{timeout_seconds, require_approval, sandbox}#11
ancongui merged 2 commits into
mainfrom
feat/enforce-execution-config

Conversation

@ancongui

Copy link
Copy Markdown
Contributor

Increment 3 (integrity gaps). These ExecutionConfig fields were declared but read by zero lines β€” the security docs over-claimed. Now enforced:

  • timeout_seconds β€” SIGALRM wall-clock guard (main thread); runaway/infinite code is interrupted and raised as FeatureExecutionError.
  • require_approval β€” fail-closed HITL gate: code runs only if a wired approver grants it (and rejects if required but no approver is available).
  • sandbox β€” in-process monty/local run the restricted executor; docker/e2b fail fast instead of silently running in-process (so you can't mistake in-process for container isolation).

Defaults are unchanged (no timeout, no approval, in-process), so existing code/tests/samples are unaffected. The GenAI auto-config wires timeout_seconds + sandbox from config.execution. security.md updated to match reality (timeout + approval enforced; budget_usd pre-call enforcement remains roadmap).

TDD: 5 real enforcement tests (timeout, docker-rejected, in-process-runs, approval allow/deny/fail-closed, defaults-unchanged). Local gates green: ruff/format/pyright/24 tests + strict docs.

Andres Contreras added 2 commits June 25, 2026 20:27
These were declared config fields read by zero lines (a security-integrity gap
the docs over-claimed). FeatureCodeExecutor now enforces them (opt-in params,
defaults preserve behavior):
- timeout_seconds: SIGALRM wall-clock guard (main-thread); times out runaway code
- require_approval: fail-closed HITL gate (runs only if a wired approver grants it)
- sandbox: in-process 'monty'/'local' run the restricted executor; 'docker'/'e2b'
  now FAIL fast instead of silently running in-process pretending to be isolated
The GenAI auto-config wires timeout_seconds + sandbox from config.execution.
security.md updated: these are now enforced (budget_usd remains roadmap). TDD.
…nt control drop)

Security-review Finding 1 (fail-open): the auto-config threaded timeout +
sandbox from config.execution but silently dropped require_approval, so the
documented HITL default was not applied on the wired path. Now the full
execution config is wired; with the default require_approval=True and no
approver, wired GenAI fail-closes (secure-by-default) β€” set
execution.require_approval=False or wire an approver to run unattended.
TDD: asserts the wired executor carries timeout/sandbox/require_approval and
fail-closes by default.
@ancongui ancongui merged commit 8c91872 into main Jun 25, 2026
4 checks passed
@ancongui ancongui deleted the feat/enforce-execution-config branch June 25, 2026 18:42
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.

1 participant