Phew Install

How to use an AI coding agent safely in VS Code

Updated · 2 min read

An agent that edits files and runs commands needs limits. Here is how Phew keeps you in control, which settings to choose, and what no agent can fully prevent.

Review every change

  • Keep and Undo in the editor. Each change of the agent shows in the file, with Keep and Undo for each part, each file, or all.
  • Ask first. Set Edits to Ask first in the approvals panel under the input to approve each change before it is written.
  • Checkpoints. Each request is a checkpoint. Restore checkpoint reverts all changes after it, also after a restart.

Approve commands

Choose Careful, Balanced, or Autopilot in the approvals panel under the input. In the default Smart mode for commands (phew.commands.approval), commands that only read run at once, and the rest ask first. A chain such as git status && git log runs without asking only when every part only reads.

Some commands always ask, whatever you allowed: rm -rf, sudo, git push --force, terraform apply, scripts piped from the internet into a shell, and any command that names a file with secrets. Add prefixes to phew.commands.deny to block commands for good.

The approvals panel: Careful, Balanced, and Autopilot, with rows for edits, commands, and MCP tools
One click sets how far the agent may go with edits, commands, and MCP tools.

Keep secrets away from the model

  • Phew does not read .env files, SSH keys, cloud credentials, .npmrc, and similar files. Add your own names in phew.privacy.sensitiveNames.
  • A command such as cat ~/.aws/credentials always asks first.
  • Phew removes known kinds of keys and tokens from command output before it goes to the model.
  • Passwords that a program asks for go from you to the program, never to the model.

Open unknown code safely

In a folder that VS Code does not trust, Phew only answers questions: it does not change files, run commands, start MCP servers, or read the rules of the project. Model settings come only from your user settings, so a project cannot redirect your API key.

Limit the cost

Set phew.budget.maxCostPerTask or phew.budget.maxTokensPerTask. A task stops when it reaches the limit, subagents included.

What no agent can fully prevent

Text in a file or a web page can try to talk a model into something harmful. This is called prompt injection. Approvals, the protection of secrets, and review limit the damage, but they cannot make a model immune. Read what a command does before you approve it, and keep Autopilot for projects that you trust.