Pi Jev Auto Mode
A fail-closed permission gate for Pi shell commands and file changes.
Per-dimension scores and reasoning
Least privilege is reasonably designed: the gate covers only bash, write, and edit and distinguishes read-only operations, in-project writes, protected paths, and hard denials. It still permits high-impact commands without per-call confirmation when auto mode is enabled, so this scores 2. Confirmation is available through the ask setting and fails closed without a UI, but it is not the default path; moreover, the README says the uncertain band defaults to blocking while the test explicitly expects default allowance, limiting this to 1. Data-flow disclosure earns full marks because it identifies the TypeSafe endpoint, transmitted fields, exclusions, truncation, and context boundaries. Sensitive-data handling has tested redaction, no file-content transmission, key verification, and 0600 storage, but pattern-based redaction cannot cover every secret format and commands, paths, working directory, user messages, and policy notes still leave the machine, so it scores 2. Dependency security scores 1 because the runtime dependency set is small, but no lockfile, audit, immutable pinning, or vulnerability-response evidence is supplied. External effects are categorized, recorded, and escalated, yet the semantic engine can approve commands such as git reset --hard and matched scope bypasses judgment for unmatched calls, so this scores 2. Configuration can be disabled or cleared and thresholds reset, but completed shell and file effects have no transactional rollback, scoring 1. Attribution earns 3 because the README names the adapted project, Qwen Code influence, official SDK, and MIT basis, consistently with LICENSE and package metadata; publisher identity remains unknown as required.
The documentation, offline CI, and tests cover hard-deny precedence, missing credentials, timeouts, cancellation, thrown errors, and headless operation. However, a security-critical contradiction remains: the README says the uncertain band defaults to deny, while the extension test explicitly describes and asserts default allowance. Self-consistency therefore scores 1. Dependency availability scores 2 because Node and Pi requirements, optional peer dependencies, Jev early access, and no-key degradation are documented, but semantic decisions depend on a remote waitlisted service with no offline substitute. Failure messages score 3: tests show actionable distinctions for disconnection, timeout, cancellation, engine error, and user rejection, along with recorded sources and reasons.
Audience and scenarios score 3 because the material clearly targets Pi users and covers interactive development, CI, ordinary work, risky commands, inside/outside-project writes, and missing API credentials. Capability boundaries score 3 because covered tools, fast paths, hard rules, semantic escalation, outbound data, and undecidable states are explicit. Trigger precision scores 2: ordering and rules are extensively described and tested, but wildcard and shape matching can miss cases, safeCommands can outrank dangerous matches, and matched scope intentionally leaves unknown calls unjudged. Environment fit scores 2 due to global and trusted-project configuration, environment overrides, headless handling, and Linux/macOS CI, offset by the Node 22.19, Pi, and remote Jev requirements and absence of Windows evidence.
The README is well organized around installation, usage, tuning, configuration, data flow, release, development, and source responsibilities, so information architecture and installation notes score 3. Naming is generally coherent, but only one revision is available and the documented default uncertain policy conflicts with tests, so naming stability scores 2. Examples are extensive but there is no full FAQ, and referenced design, calibration, and detailed security documents are absent from the supplied evidence, yielding 2. Latency, early access, pattern limits, missing-key behavior, and some known risks are disclosed, but the disputed default weakens the limitations account, yielding 2. The complete MIT license matches metadata and scores 3. A release and Unreleased workflow plus version 0.4.1 are shown, but no CHANGELOG contents or tag history are supplied, so versioning scores 2. The author, repository, issue tracker, and private advisory path identify an update channel, but no team, response target, or maintenance commitment is shown and publisher identity is unverified, so maintenance responsibility scores 2.
Status indicators, commands, expandable decision records, probability tables, explicit block reasons, and live configuration make outputs directly usable, earning 3. The deterministic-plus-semantic gate adds clear value to a Pi environment described as lacking built-in permissions, with fail-closed handling and bounded disclosure, earning 3 for marginal value. Fast paths reduce cost and measured latency is disclosed, but the external early-access API adds delay and availability friction, ordinary work may be blocked, and the uncertain-default contradiction clouds the trade-off, so cost-benefit scores 2.
Many claims map to named components and supplied tests, including redaction, intent extraction, hard-deny precedence, failure handling, and records. However, the 171-test count, calibration probabilities, latency figures, and threshold basis rely on omitted material, while the uncertain-default claim conflicts with a test; claim traceability therefore scores 2. README, SECURITY.md, package metadata, CI, and tests corroborate several safety and installation claims, but implementation files, a lockfile, design/calibration/security detail, and the changelog are not supplied, so cross-source corroboration scores 2. The documentation often distinguishes measurements, configurable policy, and design claims and warns that thresholds are not truth, but the broad fail-closed/default-deny account is contradicted by the test and some measurements cannot be independently checked here, so fact/inference separation scores 2.
- The README says uncertain decisions block by default, but test/extension.test.ts explicitly asserts default allowance. Do not rely on defaults until this security-critical contradiction is resolved.
- gateScope="matched" lets unmatched calls bypass semantic judgment; use it only if that coverage gap is acceptable.
- safeCommands can outrank a dangerous match and produces no decision record. Treat it as a high-trust local allowlist and keep it minimal.
- Semantic judgments send command text, paths, working directory, recent user messages, and policy notes to api.typesafe.ai; regex redaction cannot guarantee detection of every custom credential.
- Jev early access, waitlisting, or service outages will block all calls requiring semantic judgment. Validate no-key and offline workflows in advance.
- The supplied evidence omits a lockfile, implementation sources, CHANGELOG, and referenced design, calibration, and detailed security documents, so dependency resolution, complete threshold rationale, and the “171 tests” claim cannot be statically confirmed.
What does this agent do, and when should you use it?
Pi Jev Auto Mode is a Pi coding agent extension that gates bash, write, and edit tool calls. It applies a deterministic policy first, covering hard denials, user rules, dangerous-command patterns, protected paths, and trusted fast paths, then escalates unresolved calls to TypeSafe's Jev decision model. With the default gateScope of all, every operation not vouched for by local policy receives semantic review; uncertainty, timeouts, malformed responses, and unavailable decisions resolve to a block. The /jev-auto-mode interface controls activation, credentials, scope, uncertainty handling, policy notes, and per-rule thresholds, while expandable decision records expose condition probabilities. It runs inside Pi and stores settings and credentials in Pi's agent directory; semantic review uses api.typesafe.ai, although deterministic protections continue to work without a key.
For each Pi bash, write, or edit call, src/extension.ts orchestrates the gate. src/policy.ts evaluates hard-deny rules, allowedCommands, disallowedCommands, safeCommands, dangerous patterns, and protected paths: explicit denials are blocked immediately, while built-in read-only commands, user-declared safe commands, and unprotected in-project writes can take a fast path. For escalated calls, src/call.ts builds a bounded, redacted judgment state; write and edit send the target path but never file contents or diffs. src/intent.ts supplies only recent user-authored intent, src/jev/engine.ts makes one Jev request per judgment, and src/jev/decide.ts converts condition probabilities, modes, severities, and two-sided thresholds into allow or block outcomes. Missing engines or keys, cancellation, timeouts, transport errors, and malformed answers block calls that cannot otherwise be approved, while src/records.ts stores and renders the resulting decision entries.
- A developer who wants Pi to complete routine coding workflows without repeated prompts but does not want unknown operations silently approved.
- A maintainer who wants commands such as npm publish, sudo, git reset --hard, or destructive deletion to receive additional policy review.
- A team that needs special handling for sensitive locations such as .env, .git, ~/.ssh, .pi, .github/workflows, or AGENTS.md.
- A user who wants machine-specific test and type-check commands on a safeCommands fast path while retaining records for dangerous-rule overrides.
- An advanced adopter who wants to inspect per-condition probabilities and calibrate semantic thresholds against real workloads.
What are this agent's strengths and limitations?
- The two-layer design keeps hard denials outside the model, so semantic judgment cannot reinterpret them as allowed.
- It fails closed: uncertainty, network failures, timeouts, cancellation, and invalid responses do not silently approve a call.
- The default gateScope=all reviews every call that local policy cannot positively vouch for instead of relying solely on a denylist.
- Semantic requests exclude file contents, diffs, assistant output, and tool output, and obvious credential formats are redacted.
- Per-rule thresholds, observed probabilities, decision records, and layered trusted-project settings provide concrete tuning and audit controls.
- The integration is specific to Pi coding agent, with no documented adapter for ChatGPT, Codex, Claude, or a general-purpose agent API.
- Full semantic judgment depends on TypeSafe's Jev service and an API key; Jev is early access and accounts may be waitlisted.
- Judged calls add a measured 193–642 ms of latency and send bounded, redacted call context to api.typesafe.ai.
- Fail-closed defaults can interrupt legitimate work, so adopters may need to refine policy wording, thresholds, or fast paths.
- Project overrides work only for trusted projects, requiring adopters to plan how global and project-specific policies should be divided.
How do you install or deploy this agent?
Pi coding agent is required. Install the npm package with:
pi install npm:pi-jev-auto-modeAlternatively, install directly from GitHub:
pi install git:github.com/jomatsu/pi-jev-auto-modeTo try it without installation:
pi -e npm:pi-jev-auto-modeThe Jev semantic layer requires a TypeSafe API key. Run /jev-auto-mode login inside Pi to verify it through GET /v1/models and save it with mode 0600, or provide TYPESAFE_API_KEY. TYPESAFE_DEFAULT_MODEL selects the model and defaults to jev-latest.
How do you use this agent?
After installation, run /jev-auto-mode on, or start Pi with pi --jev-auto-mode. Use /jev-auto-mode to inspect status and credential origin; /jev-auto-mode scope all|matched controls how broadly semantic review applies, with all as the default; /jev-auto-mode uncertain deny|ask|allow controls the middle probability band, with deny as the default. Run /jev-auto-mode threshold to inspect thresholds and recent probabilities, then /jev-auto-mode threshold <rule> <0.5-1> to persist an override. Global configuration lives at $PI_CODING_AGENT_DIR/jev-auto-mode.json, while a trusted project may override it with <cwd>/.pi/jev-auto-mode.json; settings include safeCommands, allowedCommands, disallowedCommands, extraProtectedPaths, and timeoutMs. Without an API key, deterministic fast paths and hard denials still work, but calls requiring Jev are blocked with “Not connected to Jev.”How does this agent compare with similar options?
Its deterministic pattern catalogue is adapted from @nilskluewer/pi-auto-permission-gate, and the README relates its fast-path → hard-rule → classifier structure to both that extension and Qwen Code's Auto Mode. The documented distinction is the TypeSafe Jev judgment layer, combined with fail-closed outcomes, meaningful two-sided thresholds, one API request per judgment, and recorded per-condition probabilities.