Quick Setup: Add the Skill
The fastest way to integrate YesPaPa with an AI agent is to add it as a skill:Overview
YesPaPa is transparent to agents — intercepted commands simply block until approved. But agents can improve the experience by:- Providing justification for why a command is needed
- Parsing structured JSON events to understand approval status
- Reading approver messages for feedback
Justification
The--justification flag tells the human approver why the agent needs to run a dangerous command. It appears in the terminal prompt, push notification, and mobile app.
Via shell (passthrough)
--justification from the arguments before sending the command to the daemon.
Via CLI (direct)
exec command provides structured JSON output and is better suited for programmatic use.
Structured JSON Output
YesPaPa emits structured JSON events on stderr for all intercepted commands. Agents can parse these to understand approval status programmatically — no environment variable needed.Event types
Command approved:Source values
| Source | Meaning |
|---|---|
remote | Approved/denied from mobile app |
totp_stdin | User typed TOTP code in terminal |
grace_token | Auto-bypassed by active grace period |
sudo_bypass | Auto-approved sudo command (when allow_sudo_bypass is true) |
Approver Messages
When a human approves or denies from the mobile app, they can include a message. This message flows back to the agent through:- The
messagefield in JSON events - Human-readable output on stderr
- The
command_logtable in the local database
Socket Protocol
For advanced integrations, agents can communicate directly with the daemon over the Unix socket at/tmp/yespapa.sock.
Phase 1: Send command
timeout field indicates how many seconds until the command is auto-denied (0 = wait forever). Configurable via yespapa config set default_timeout <seconds>.
Status values: approved, denied, needs_totp, error, timeout
Phase 2a: Submit TOTP code
Phase 2b: Poll for remote approval
needs_totp.
System Prompt Template (Manual Alternative)
If your agent doesn’t support skills, add this to the system prompt manually:Grace Periods
If the human has activated an auto-bypass (grace period), commands matching the bypassed scope execute immediately without TOTP. The agent sees:destructive commands) and time-limited (1h, 24h, 7d). The agent cannot create or extend grace periods — only the human can, via TOTP or the mobile app.
Command Log
All intercepted commands are logged in the local SQLite database at~/.yespapa/yespapa.db in the command_log table:
| Column | Description |
|---|---|
id | Command ID (e.g., cmd_abc123def456) |
command | Full command string |
justification | Agent’s justification (if provided) |
status | pending, approved, denied, timeout, grace |
approval_source | totp_stdin, app_approve, grace_token, sudo_bypass |
message | Approver’s feedback message |
created_at | When the command was intercepted |
resolved_at | When the command was approved/denied |