Skip to content

feat: tools allowlist - #26

Merged
pablopunk merged 5 commits into
pablopunk:mainfrom
mponcet:feat/tools-allowlist
Sep 3, 2026
Merged

pablopunk merged 5 commits into
pablopunk:mainfrom
mponcet:feat/tools-allowlist

Conversation

@mponcet

@mponcet mponcet commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

I don't want pi to execute (risky) bash commands 😅

@pablopunk

Copy link
Copy Markdown
Owner

great one! given pi.nvim has no interaction other than reading and writing files, I don't think we should allow users to disable read/write tools, so the table should not consider those and always pass them down

Args Send
tools = {} --tools read,edit
tools = { "read" } --tools read,edit
tools = { "bash" } --tools read,edit,bash

do you agree?

also a unit test would help here

@mponcet
mponcet force-pushed the feat/tools-allowlist branch from 5d12c39 to e187a7c Compare September 3, 2026 14:37
@mponcet

mponcet commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Yes it makes sense. I added a unit test to validate this behavior ( tools = { "bash" } should give --tools read,edit,bash)

Also added some basic validation/type check of opts.tools .

Comment thread lua/pi/init.lua Outdated
Comment thread tests/test_pi_commands.lua Outdated
@pablopunk
pablopunk merged commit 62bbf5f into pablopunk:main Sep 3, 2026
4 checks passed
@pablopunk

Copy link
Copy Markdown
Owner

thank uuuuuuuu

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.

2 participants