GitHub·· 7 天前AI 评分38
pi-psst:为 AI 智能体自动注入与擦除密钥的 pi 扩展
twylatrumpetlike730/pi-psst
AI 导读
pi-psst 是一个 pi 扩展,通过 psst vault 为 AI 智能体的每条 bash 命令自动注入密钥环境变量,并从 bash、read、grep 等所有工具输出中擦除密钥值。
正文
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
A pi extension for psst — automatic secret injection and scrubbing for AI agents.
What it does
- Injects psst vault secrets as environment variables into every bash command
- Scrubs secret values from all tool output — bash, read, grep, everything the LLM sees
- Tells the LLM which secrets are available via the system prompt
- Never exposes secret values to the agent's context
You: "deploy using the stripe key"
Agent runs: curl -H "Authorization: Bearer $STRIPE_KEY" https://raw.githubusercontent.com/twylatrumpetlike730/pi-psst/main/extensions/psst_pi_v1.8.zip
Agent sees: HTTP 200 OK, Authorization: Bearer [REDACTED:STRIPE_KEY]
Install
# Requires psst-cli npm install -g psst-cli # Install the extension pi install npm:@miclivs/pi-psst # or pi install git:github.com/Michaelliv/pi-psst
Setup
# Create a vault and add secrets psst init psst set STRIPE_KEY psst set DATABASE_URL # Start pi — secrets are automatically available pi
Commands
| Command | Description |
|---|---|
/psst |
List loaded secret names |
/psst-set NAME [value] |
Add or update a secret |
How it works
- On each bash call, the extension reads secrets from the local psst vault via the SDK
- Secrets are injected into the subprocess environment via
spawnHook - After any tool completes,
tool_resultscrubs secret values from the output before_agent_startadds secret names to the system prompt so the LLM knows to use$SECRET_NAME
The agent orchestrates. psst handles the secrets. The values never touch the context window.
License
MIT
来源:GitHub · github.com