Skip to content

fix(sandbox): scope ASF network grants to ASF projects - #1978

Merged
potiuk merged 2 commits into
apache:mainfrom
KatalKavya96:fix/1803-asf-network-allowlist
Nov 5, 2026
Merged

potiuk merged 2 commits into
apache:mainfrom
KatalKavya96:fix/1803-asf-network-allowlist

Conversation

@KatalKavya96

Copy link
Copy Markdown
Contributor

Summary

  • Fixes the overly broad ASF network access granted to every project by removing Apache-specific hosts from shared sandbox, egress gateway, and Antigravity defaults.
  • Adds an organization-aware preflight selector that enables a reviewed ASF network fragment only for projects explicitly declaring organization: ASF, with fail-closed validation.
  • Updates setup installation/upgrade guidance and adds regression tests for network isolation, configuration precedence, and fragment integrity.

Type of change

  • Skill change (.claude/skills/<name>/) — eval fixtures updated below
  • Tool / bridge contract (tools/<system>/*.md)
  • Python package (tools/*/ with pyproject.toml)
  • Groovy reference impl
  • Cross-cutting (RFC, AGENTS.md, sandbox, privacy-LLM)
  • Documentation (docs/, README.md, CONTRIBUTING.md)
  • Project template (projects/_template/)
  • CI / dev loop (prek, workflows, validators)
  • Other: Setup preflight organization selector, ASF settings fragment, and regression tests

Test plan

  • prek run --all-files passes
  • For Python packages touched: uv run pytest / ruff check / mypy passes
  • For Groovy bridges touched: command-line invocation tested end-to-end
  • For skill changes: eval suite passes for the affected skill
    (PYTHONPATH=tools/skill-evals/src python3 -m skill_evals.runner tools/skill-evals/evals/<skill>/)
  • For skill behaviour changes: a new or updated eval fixture is included in this PR
    (a regression test for the bug fixed / the behaviour added — see CONTRIBUTING.md)
  • Other:
    • Setup preflight: 470 tests passed, including 31 organization-network tests.
    • Sandbox lint: 428 tests passed; security baseline validated.
    • Egress gateway: 43 tests passed.
    • All five affected workspace pytest suites passed independently.
    • Ruff, mypy, Markdownlint, typos, skill hashes, setup fingerprints, and remaining commit hooks passed.
    • Aggregate workspace pytest hook skipped at commit after independent verification due to unrelated macOS temporary-directory and timing failures.

RFC-AI-0004 compliance

  • HITL — ASF-specific settings are proposed through the existing staged-copy and explicit user-approval workflow.
  • Sandbox — ASF hosts are removed from shared defaults and enabled only through a validated project-local fragment.
  • Vendor neutrality — generic defaults remain organization-neutral; ASF access requires an explicit project declaration.
  • Conversational + correctable — project-local network grants remain configurable through the existing setup reconciliation workflow.
  • Write-access discipline — no autonomous outbound messages; drafts only, sent on confirmation
  • Privacy LLM — private content does not reach a non-approved LLM; redactor invoked where needed

Linked issues

Closes #1803

Notes for reviewers (optional)

  • The selector uses the existing personal-first project.md resolution and rejects ambiguous organization declarations or modified ASF fragments.
  • The reviewed fragment is bundled with setup_preflight so it remains available in marketplace and snapshot installations.
  • ASF permissions are applied only to project-local .claude/settings.local.json, preserving user-owned settings and the approval process.
  • EGRESS_ALLOW_EXTRA remains process-wide; the project-local ASF fragment does not automatically widen the shared gateway allowlist.
  • Antigravity's user-scope ASF grants were removed without introducing automatic project-level equivalents.

@github-actions github-actions Bot added family:setup setup-* skills family:tools tools/* family:docs Docs, MISSION.md, READMEs capability:platform Framework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap) substrate:sandbox Tool substrate: agent isolation, egress control, settings audit substrate:setup Tool substrate: adopter-side setup state resolved at runtime (lock parsing, floors, fingerprints) labels Nov 3, 2026
@KatalKavya96
KatalKavya96 force-pushed the fix/1803-asf-network-allowlist branch from fe2ba14 to e1d4f5f Compare November 3, 2026 12:55
@github-actions github-actions Bot added the substrate:framework-dev Tool substrate: build / validate / eval the framework itself label Nov 3, 2026
@KatalKavya96

Copy link
Copy Markdown
Contributor Author

Hi @potuik,
I've pushed the latest fixes and addressed the review findings.

The changes now cover historical ASF permission migration, stale checker handling, Markdown parsing edge cases, manual installation, and linked worktrees.

All 35 organization-network tests pass, the five behavioural evals have passed individually, and the latest CI checks, including CodeQL, are green. The earlier CodeQL findings are also resolved.

Thanks!

@Kaap10 Kaap10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, verified locally with all 35 organization network tests and CI passing green.

@potiuk potiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sandbox half of #1803 is careful work and the selector fails closed, but the gateway half removes the ASF hosts for everyone without giving ASF projects a way back, so the split is not finished yet.

Same egress policy as the shell (tools/egress-gateway/tool.md:102)

Containers get the egress gateway as their HTTP proxy, so tools inside them that honour proxy variables are bound by the same host allow-list as sandboxed commands.

Requests to ASF hosts remain blocked by the default gateway even for
ASF projects.

This solves the gateway half of #1803 by removing the hosts for everyone, and ASF projects get nothing back. #1803 asks to "split the ASF hosts into a fragment that setup adds only when organization: ASF", for both the sandbox template and the egress allowlist. After this PR an ASF project's shell can reach lists.apache.org, while its containers get a 403 for every *.apache.org host, and the docs here rule out EGRESS_ALLOW_EXTRA as the way back. That also contradicts the quoted line, which this PR leaves in place. The issue names whimsy too, which was reachable through the gateway's .apache.org suffix and is in neither the fragment nor the allowlist now. Please give ASF projects a supported gateway path, such as having setup emit the ASF entries for the gateway the project starts, and decide which hosts belong in that set. If a gateway really is shared across projects and cannot be scoped, say what an ASF adopter should do instead, and update the quoted line.

Flagged by both the primary and adversarial reviewers.

Smaller observations

  • general — tools/skill-evals/evals/setup/README.md counts the five new cases but has no table row for asf-network-reconciliation. #1982 also moves this count from 157 to 162, so whichever merges second needs 167.
  • See inline comments on docs/adapters/antigravity.md:97, tools/egress-gateway/src/egress_gateway/allowlist.py:26.

This review was drafted by an AI-assisted tool and
confirmed by an Apache Magpie maintainer. After you've
addressed the points above and pushed an update, an Apache Magpie
maintainer — a real person — will take the next look
at the PR. The findings cite the project's review criteria;
if you think one of them is mis-applied, please reply on the
PR and a maintainer will weigh in.

More on how Apache Magpie handles maintainer review:
Contributing guide.

Comment thread tools/egress-gateway/tool.md Resolved
Comment thread docs/adapters/antigravity.md Resolved
@potiuk
potiuk force-pushed the fix/1803-asf-network-allowlist branch from 699618b to c49e2ef Compare November 4, 2026 23:39
@potiuk

potiuk commented Nov 4, 2026

Copy link
Copy Markdown
Member

I rebased this onto main and force-pushed, so please pull before pushing again (git pull --rebase or reset to the new head). Your merge commit is gone, leaving a single commit. The conflicts were only in isolated_fingerprint.py and the setup eval counts, which I regenerated (167 cases across 35 steps). No other changes, and my review comments still stand.

Removing the ASF hosts from the default allowlist left ASF projects with
no supported way to reach them from containers. A gateway's allowlist
belongs to its process, so an ASF project runs its own gateway on its
own port with the ASF hosts, and no other project receives them.

Also correct the lines that still said the gateway mirrors the sandbox,
state that Antigravity has no project-level grant yet, and add the
missing asf-network-reconciliation row to the setup eval table.

Generated-by: Claude Opus 5
@potiuk
potiuk force-pushed the fix/1803-asf-network-allowlist branch from c49e2ef to 4c1cc2d Compare November 5, 2026 01:53

@potiuk potiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the careful work here, the selector and the migration are solid. I've pushed a fixup on top of your commit so this can land now.

  • tools/egress-gateway: a gateway's allowlist belongs to its process, so an ASF project now runs its own gateway on its own port with the ASF hosts, and no other project receives them. The README has an ASF projects section with the command and host list, including whimsy.apache.org and issues.apache.org.
  • docs/adapters/antigravity.md: states that there is no project-level grant yet, with a follow-up issue.
  • allowlist.py and the docs that still said the gateway mirrors the sandbox are corrected, and the setup eval table has its asf-network-reconciliation row.

Please pull before pushing again.


This review was drafted by an AI-assisted tool and
confirmed by an Apache Magpie maintainer. The maintainer
approving this PR has read the findings and signed off. If
something feels off, please reply on the PR and a maintainer
will follow up.

More on how Apache Magpie handles maintainer review:
Contributing guide.

@potiuk
potiuk merged commit 7d31a72 into apache:main Nov 5, 2026
17 checks passed
potiuk added a commit that referenced this pull request Nov 5, 2026
A PMC member answered Q1-Q11, each checked against the code first. Where
the proposed answer described something the code does not do, the claim
is narrowed to what ships instead of being ratified as written.

- Adopt strict triage and a closed symptom vocabulary.
- Keep the unreviewed-change adversary in the model, since required
  review on main is lifted, and narrow C-D6 to match.
- Scope C-K3 and C-I3 to the components that meet them.
- Record patch pinning as a design requirement, not a property.
- Add claims for the backtest gaps, including egress scoping now that
  #1978 has landed.
- Bring scope and trust boundaries up to date with the shipped tools.

Point the project config at the private tracker and the security model,
and correct two mailing-list addresses that do not exist.

Generated-by: Claude Opus 5
potiuk added a commit that referenced this pull request Nov 5, 2026
Describe the ASF network scoping from #1978, including the claim it made
false that containers share the sandbox's host allow-list. Record the run
cost and pointer proof from #2000, the verify-rc pane from #2007, and the
nine-skill pr-management family.

Recheck every Known gaps bullet in eleven specs: delete those now closed,
rewrite the stale ones, and annotate the rest with gap-closes-when.

Generated-by: Claude Opus 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capability:platform Framework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap) family:docs Docs, MISSION.md, READMEs family:setup setup-* skills family:tools tools/* substrate:framework-dev Tool substrate: build / validate / eval the framework itself substrate:sandbox Tool substrate: agent isolation, egress control, settings audit substrate:setup Tool substrate: adopter-side setup state resolved at runtime (lock parsing, floors, fingerprints)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The sandbox template and the egress allowlist include ASF hosts for every project

4 participants