Repository navigation
Conversation
Signed-off-by: eshulman2 <ellashulman1@gmail.com>
E2E tests did not runE2E tests run automatically for pull requests authored by users with write access or higher. For other contributors, someone with write access must add the Reason: See E2E testing guide for details. |
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can move or hide resolved findings to focus on what still needs action |
PR Summary by QodoDocument exact, least-privilege Pi extension tool selection
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
ascerra
left a comment
There was a problem hiding this comment.
I'm for this. I hit the same limit with a small extension (code): once tools: names a built-in, Pi hides the extension tools, so I had to leave tools: off entirely (note).
One thing that may help now: with tools: left off, extension tools already run on fullsend. I ran them in a GitLab pipeline on v0.55.0 (results). So the CVE extension may not need to wait for this to run, only to be locked down. I haven't tried that extension itself.
Two questions inline.
| The effective tool set is explicit, including when empty. Hook authorization | ||
| uses the same canonical native name. Child runs, if supported, load the vetted | ||
| code that supplies a requested tool and receive only the intersection of | ||
| parent and child permissions. A runtime path that cannot enforce this refuses | ||
| the selection. Repository discovery cannot supply tools or alter identity; |
There was a problem hiding this comment.
What should the same agent file do on a runtime that doesn't load the extension?
This is not a blocker for the CVE work, since we're going Pi first. But tools: is written once for every runtime, and the adopter picks the runtime.
Today my agent runs on both because it declares no tools. Pi calls the extension tools, and Claude Code runs the same commands through Bash. If I list the tools:
- Does Claude Code ignore them or refuse the run?
- Adding
Bashfor Claude Code gives Pi a shell too.
If this is for Pi-only agents, could the ADR say so?
| Keep existing built-in translations. Treat an otherwise unmapped exact name | ||
| as a requested native extension tool, and resolve it only after loading the | ||
| runner-vetted extension set. A missing or ambiguous requested tool fails the | ||
| run before inference. It never falls back to all extension tools, Pi defaults |
There was a problem hiding this comment.
Today an unmapped name is dropped with a warning (internal/runtime/pi_bootstrap.go). After this it fails the run. I think that's right, but it is a behavior change for custom agents that list a Claude-only tool.
Could the ADR note that, and say how the runner tells a Claude-only built-in like WebFetch from a missing extension tool?
Our own agents only list Bash and Skill, so they're fine.
Summary
Record the decision to select exact native Pi extension tools without widening access. A vetted extension can load today while its declared native tool name is dropped by strict tool translation.
Related Issue
Split from #9261 so each PR contains one decision and only its related living-document changes. Implementation is tracked in #9254; this documentation PR does not implement or close that issue.
Changes
Forge-neutral: the same Pi runtime contract applies on GitHub, GitLab and Forgejo. Coordinate implementation with #9179 rather than duplicating its MCP and child-permission changes.
Current-behavior evidence
Inspected baseline:
7455751ecb9446953527dbf73b4e379ea5442cb0.Testing
make lint; applicable ADR, link, secret and Semgrep checks pass.git diff --checkpasses.Checklist
Prepared with coding-agent assistance; the contributor can assess the personal-authorship attestation.