@tridha643/pi-ask-mode
v0.1.0
Published
A pi package that adds ask mode: read-only investigative tools plus read-only bash.
Maintainers
Readme
pi-ask-mode
A shareable pi package that adds ask mode.
Ask mode is a read-only investigative mode for analysis, debugging, exploration, and answering questions without using file mutation tools or interactive UI prompt tools.
What ask mode enables
When ask mode is on, pi uses these tools:
readbashgrepfindlssubagentif it exists in the current pi environment
What ask mode blocks
Ask mode blocks these tools:
editwritequestionquestionnaireaskUserQuestion(if another extension registers it)
It also restricts bash to read-only / investigative commands.
Examples of allowed shell usage:
ls,tree,pwdcat,head,tail,file,statgrep,rg,find,fdgit status,git log,git diff,git show,git rev-parsegit branch --show-current,git branch --list,git remote -v,git remote show originnpm list,npm info,npm outdated,npm audit --jsonenv,printenv,uname,whoami,ps,uptimejq,awk,sed -nhelp,man, and CLI help/version commands likefoo --help,foo help,foo --version- broadly, arbitrary CLIs for read-only inspection like
gh pr view,terraform plan, orkubectl get ... curlandwget -O -for read-only fetching
Examples of blocked shell usage:
- file mutation like
rm,mv,cp,mkdir,touch - editors like
vim,nano,code - package installs like
npm install,pnpm add,brew install - package mutation like
npm audit fix - git writes like
git add,git commit,git push,git branch feature-x,git remote add origin ... - common mutating CLI actions like
gh repo create,terraform apply,kubectl apply,docker run - output redirection like
>or>> - command substitution like
`...`or$(...) - privilege/system actions like
sudo,kill,shutdown
Install
Global install
pi install /absolute/path/to/pi-ask-modeWhen published, users can install it globally with:
pi install npm:pi-ask-modeor:
pi install git:github.com/<owner>/pi-ask-modeUsage
Slash command
/askToggle ask mode on or off.
You can also use:
/ask on
/ask off
/ask statusStart pi directly in ask mode
pi --askBehavior
When ask mode is enabled:
- pi switches active tools to
read,bash,grep,find,lsplussubagentwhen available edit,write,question,questionnaire, andaskUserQuestionare blocked defensively at tool-call timebashis limited to read-only / investigative commandssubagentis allowed only for read-only context gathering, inspection, search, analysis, and summarization- subagent management is limited to read-only actions like
listandget - subagent worktrees and output-file writes are blocked
- the model is instructed to ask the user directly in normal chat instead of using UI prompt tools
- if pi starts with
--ask, ask mode captures the current tool selection so/ask offcan restore it later
Plan mode compatibility
This package is designed to play reasonably well with plan-mode style extensions.
Switching from plan mode to ask mode
If a compatible plan-mode extension stores state in either:
plan-modepi-constell-plan-state
then running:
/askwill:
- enable ask mode
- write a disabled plan-mode state entry
- reload the runtime so the other mode shuts off cleanly
This avoids plan-mode UI prompts continuing to appear while ask mode is active.
Switching from ask mode to plan mode
Running:
/planfrom a compatible plan-mode extension should switch tools away from ask mode. On the next prompt, pi-ask-mode detects that another mode has taken over and disables ask mode state.
Testing
Run the bash safety tests with:
npm testSuggested manual smoke test:
- Launch pi with this package loaded.
- Run
/ask on,/ask status, and/ask off. - In ask mode, verify
git diffis allowed andgit commit -m "test"is blocked. - If
subagentis available, verify a read-only task likeAnalyze the auth flow and summarize the touched filesis allowed, while a mutating task likeImplement the fixis blocked. - If you use a compatible
/planextension, switch between/planand/askonce in each direction.
Important note
This is not a perfect sandbox.
Even with a read-only bash allowlist, this package is only an extension-level policy layer. It is designed to keep the agent in an investigative, non-mutating workflow, but it does not replace OS-level sandboxing.
If you need stronger guarantees, run pi inside a sandbox, container, VM, or other restricted environment.
