[doc] README: document the security model + clarify ModuleWithheldError contract#27
Merged
Conversation
…or contract
Independent re-review (2026-06-20) noted the real security boundary lived only
in godoc / Plane comments, not the README. Add README sections covering the
public release semantics:
- Security model: load gate (Policy/NewWithPolicy, default-deny, four-tier
module sets), the SetFS exception, and why the per-call fs/net/cmd/secret
exec gate is out of Starbox scope.
- Execution budgets & output limits (SetMaxExecutionSteps / SetMaxOutputEntries).
- Inspection without execution (Check / DescribeSurface), both Policy-aware.
- Structured results (output()/GetResult) and console capture.
- Typed errors (RunError{Kind}, ModuleWithheldError, OutputLimitExceededError).
Also clarify the ModuleWithheldError godoc contract: a withheld error is for a
known builtin excluded by the set/policy; a policy-denied non-builtin (custom/
dynamic/script) module is simply absent (load fails as not-found), not typed
withheld - the sandbox is not told a host-private module exists but is forbidden.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #27 +/- ##
=======================================
Coverage 98.95% 98.95%
=======================================
Files 12 12
Lines 862 862
=======================================
Hits 853 853
Misses 5 5
Partials 4 4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
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.
Independent re-review (2026-06-20) confirmed the four code fixes (#24/#25) are effective and verified, but flagged that the real security boundary lived only in
policy.gogodoc and Plane comments — not the README. This syncs the README with the actual release semantics and pins down one open contract question.README — new sections
Policy/NewWithPolicy, default-deny, four-tier module sets), theSetFSexception, and why the per-call fs/net/cmd/secret exec gate is out of Starbox scope (lives at the loader-construction layer).SetMaxExecutionSteps/SetMaxOutputEntries, enforced on every run path incl.RunnerConfig.Execute()).Check→Diagnostic,DescribeSurface→Surface), both Policy-aware.output()/GetResult, per-run) and console capture (EnableConsoleCapture/Drain).RunError{Kind},ModuleWithheldError,OutputLimitExceededError).ModuleWithheldErrorcontract (re-review "保留观察")Clarified in godoc: a withheld error is for a known builtin excluded by the set/policy; a policy-denied non-builtin (custom/dynamic/script) module is simply absent (
load()fails as not-found), not typed-withheld — the sandbox is deliberately not told that a host-private module exists but is forbidden. This is the intended, documented behavior (information hiding), resolving the open question.Doc/comment-only — no behavior change.
gofmt/vet/build/go testclean locally; full matrix runs in CI.