Skip to content

land: confined-sessions - #485

Queued
aft-alfonso[bot] wants to merge 6 commits into
mainfrom
land/confined-sessions
Queued

aft-alfonso[bot] wants to merge 6 commits into
mainfrom
land/confined-sessions

Conversation

@aft-alfonso

@aft-alfonso aft-alfonso Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Accepted agent delivery; branch-keyed search descriptor included.


Summary by cubic

Adds confine: "root" support to scoped worker catalogs, keeping a read-only worker session inside its own checkout even after an AFT restart or catalog epoch rebind. Previously a worker catalog could only request remote execution routing; now it can opt into a root-only filesystem surface.

  • Confined sessions offer only read, grep, glob, and aft_outline; all other tools are refused with tool_not_offered_confined.
  • Paths outside the checkout are refused with path_outside_confined_root without permission prompts, regardless of grants or owned bash outputs.
  • Grep and glob bypass the trigram index and use bounded filesystem walks so no results leak outside the root; replies disclose the fallback.
  • Symlinks pointing outside the root are not followed, including ignore-file symlinks and implicit Rust module include probes.
  • Confinement is monotonic: later catalog updates or epoch re-fetches cannot remove it; malformed saved policies fail closed.
  • Existing in-root credential and deny floors still apply.

Written for commit f3a34c0. Summary will update on new commits.

View guided diff Turn on auto-fix

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; both previous findings are fixed and no new blocking issue was found.

Summary

Adds confine: "root" for scoped workers, with four read-only tools and checkout-only paths.

  • Scoped worker catalogs can save a root-only read fence.
  • Read tools refuse paths outside the worker's checkout.
  • Confined searches walk only the worker's checkout.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Worker catalog] --> B[Save confinement across epochs]
  B --> C[Tool call]
  C --> D{Read-only tool?}
  D -->|No| E[Refuse tool]
  D -->|Yes| F{Path inside checkout?}
  F -->|No| G[Refuse path]
  F -->|Yes| H[Read or walk checkout]
Loading

Reviews (2) · Last reviewed commit: "mason: preserve confinement across epoch..." · Reviewed by Greptile

ualtinok and others added 5 commits October 17, 2026 08:55
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Persist confine=root in the existing full scoped catalog key and enforce it on every call, including after database reopen. Serve only read, grep, glob and aft_outline; fence canonical paths before grants or consent and bypass borrowed indexes with bounded root walks.

Capture 28 real-handler vectors with a byte-comparison test. Deliberately extend the role.describe conformance fixture with tool-catalog-confine/v1. New confinement tests, path/access/catalog regressions, list envelopes, and Windows compile pass; two existing remote-policy sandbox tests reproduce their runner failure on unchanged HEAD. Six named mutation controls redden and restore cleanly.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Explicitly review the existing read filePath spelling in the confined preflight, its legacy-wire test helper, and the captured catalog vector. Preserve the real-handler bytes rather than regenerating or broadening the publication vocabulary allowlist.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Inherit the request fence in every Rayon fallback scan callback, not just bounded filesystem helpers. Add real-handler coverage for filter-only outside-shaped patterns, helper-thread symlink refusals, permitted in-root file links, and walks encountering outside links.

Capture nine additional golden replies without changing the original vectors. Pattern inputs do not select walk roots, so those requests remain safe complete filesystem replies rather than new refusals. Five named mutation controls redden and restore cleanly; required Rust, envelope, and Windows compile gates pass, excluding the two previously proven runner sandbox baseline failures.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Comment thread crates/aft/src/db/remote_exec.rs
Comment thread crates/aft/src/commands/outline.rs
…485)

Carry prior confinement into new frozen policy rows in the same transaction, while preserving scoped identity and incoming routing params. Disable both files-mode ignore loaders for confined outlines, and validate implicit Rust test-module candidates before metadata probes. Add epoch, auxiliary-read, and byte-compared golden regressions. Existing assertions retain their meaning.

Verification: confined lib tests 21 passed; remote policy 39 passed with two runner-sandbox failures excluded (unfiltered run: 38 passed, 2 failed); remote DB 6 passed; outline 67 passed, 4 ignored; list envelope 181 passed; binary ignore fixtures 3 passed; Windows -D warnings check and rustfmt passed. Four non-vacuity controls each reddened exactly its expected regression test and were restored.
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
@ualtinok
ualtinok added this pull request to the merge queue Oct 17, 2026
Any commits made after this event will not be merged.
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 17, 2026
@ualtinok
ualtinok added this pull request to the merge queue Oct 17, 2026
Any commits made after this event will not be merged.
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