fix(remediation): allow sandbox output paths #177
No reviewers
Labels
No labels
area:authentication
area:flake-utilities
area:performance
area:tbd
host:chaos
host:electra
host:fleet
host:lyra
host:nova
host:vega
investigation
phase:cutover
phase:deploy
phase:mcp
phase:module
phase:packaging
phase:prep
phase:validation
priority:high
priority:medium
project:attic-postgres-lyra-rollout
project:auto-update-reliability
project:auto-update-remediation
project:declarative-purity-cleanup
project:external-review
project:fleet-boundary-cleanup
project:host-facts-refactor
project:lyra-nixos-deploy
project:lyra-service-stack-migration
project:nebula-mesh-network
project:nixos-build-deployment-pipeline
project:security-hardening
project:service-stack-migration
project:vega-sillytavern-cutover
project:wiki-rebuild
repo:numtide/flake-utils
repo:numtide/nix-auth
repo:numtide/nixos-passthru-cache
repo:numtide/nix-relay
service:auto-update
service:mem0
service:nix
service:sillytavern
service:slskd
service:synthseek
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
nimmo/nixos-config!177
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/issue-176-remediation-output-policy"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Validation
./tests/nixos-update-remediation-regressions.shnix flake checkRemaining live evidence
A Nova remediation canary and no-op follow-up remain required after merge; this MR intentionally uses
Refs #176rather than closing the issue.Refs #176
Automated code review
Reviewed commit:
a9e75c7b0166f659843634a5f0ebfc428ab8dfedVerdict: Ready to merge
No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory.
Overall assessment
Updates OpenCode sandbox policy to anchor read/exclude and edit/allow paths to absolute
/workspace/prefixes, preventing unintended access outside the sandboxed environment. Corresponding integration tests are updated to verify exact permission dictionaries for both top-level and nested agent configurations.Blocking findings
None.
Important findings
None.
Suggestions
"*": "allow" precedes specific deny patterns (e.g., "/workspace/.env": "deny") in the
readdictionary.Impact: Depending on the policy engine's evaluation model, a sequential first-match or allow-override rule could bypass specific deny restrictions, weakening sandbox isolation.
Suggested fix: Confirm that the underlying policy engine uses a deny-override precedence model. If it evaluates sequentially, consider placing specific deny patterns before the wildcard allow rule, or explicitly document the expected evaluation order.
Tests and validation
Questions
Review limitations
Diff coverage
scripts/nixos-update-remediation.py: reviewed — included in a context-limited batchtests/nixos-update-remediation-integration.py: reviewed — included in a context-limited batchReview metadata
Review follow-up addressed in
a9e75c7./workspaceis the single canonical sandbox root: the controller read-only binds the worktree there, rebinds the two writable output files beneath it, and starts OpenCode with both--chdir /workspaceand--dir /workspace; there is no fallback root.The audit also found the existing path-specific read exclusions were relative. They are now anchored to
/workspace(including root and nested.envfiles,.git, andsecrets), and the regression fixture asserts the exact global and agent policy maps. The remediation suite andnix flake checkpass again.Verified the remaining advisory point against the current OpenCode permissions documentation: rules are evaluated by pattern match and the last matching rule wins. The documented common pattern is exactly a catch-all first, followed by specific overrides.
Our read policy therefore deliberately has
"*": "allow"first and the/workspace/...deny rules afterwards; the latter take precedence for protected paths. No code change is needed for this advisory finding.Source: https://opencode.ai/docs/permissions/#granular-rules-object-syntax