Approvals and YOLO

Project edits, commands and file publication wait for durable approval unless a matching YOLO grant applies.

intermediate9 min read

You ask Developer to check why a project’s tests are failing. It reads a file, then proposes a Bash command. The reply pauses. There’s a card in the transcript with the command and two buttons, Approve and Deny. You can decide now, or leave the chat and come back to the same request later.

In this chapter

  • Read the approval card and tell what each button does.
  • Follow a waiting call through a restart or a change of workspace.
  • Tell when a YOLO grant applies and when Pipal asks again.

The tool stops before it touches the project

From proposed command to decision
  • Browser
  • Hono app.ts
  • Pipal core index.ts
  • Pi Durable
  • Tool router

Approve

  1. Pi Durable → Pipal core · Call bash

    Developer proposes a command

    Pipal checks that Developer has the tool and that the chat has a current workspace.

  2. Pipal core → Pi Durable · Park 1

    The tool stops at the gate

    Pi keeps the arguments and the waiting state. The Bash implementation has yet to run.

  3. Hono → Browser · Show card

    You see the tool and its arguments

    The live snapshot from core carries the tool name and the request for its current park.

  4. Browser → Hono · Approve 1

    You approve what you saw

    The browser sends the task ID in the URL and { allow: true, park: 1 } in the body.

  5. Hono → Pipal core · Check request

    Core checks that park 1 is still current

    The task must belong to this conversation and still be waiting on the park you saw, with no abort requested. In this scenario the binding is still current when the call wakes.

  6. Pipal core → Pi Durable · Deliver decision

    Pipal signals the sleeping call

    The signal names the key the call is waiting on. Pipal credits the waiting time back to the run.

  7. Pi Durable → Pipal core · Wake

    The tool passes the gate

    The wrapper checks the current grants and scope. An approval for that scope lets the original command run.

  8. Pipal core → Tool router · Run tool

    The host dispatches Bash

    The router rechecks the location, scope and tool before forwarding the call to the backend.

Deny

  1. Pi Durable → Pipal core · Call bash

    Developer proposes a command

    The same gate applies.

  2. Pipal core → Pi Durable · Park 1

    Pi records the wait

    The Bash implementation has yet to run.

  3. Hono → Browser · Show card

    The browser shows park 1

    The card presents the tool and its saved arguments.

  4. Browser → Hono · Deny 1

    You decline the call

    The browser sends { allow: false, park: 1 }.

  5. Hono → Pipal core · Check request

    Core checks that park 1 is still current

    Denial uses the same conversation, task, park and abort checks as approval.

  6. Pipal core → Pi Durable · Deliver denial

    Core wakes the sleeping call

    Core sends the denial on the signal key for park 1.

  7. Pi Durable → Pipal core · Wake

    The wrapper reads the denial

    It clears the approval details and throws before the command can run.

  8. Pipal core → Pi Durable · Tool error

    The model sees a failed tool result

    Pi turns the thrown error into a failed tool result. The model can respond to the failure.

YOLO

  1. Browser → Hono · Enable YOLO

    You opt in for an idle chat

    The browser sends yolo: true in the chat settings.

  2. Hono → Pipal core · Save scope

    Core saves the current scope with the chat

    The chat must have a current workspace scope.

  3. Pi Durable → Pipal core · Call bash

    The next reply proposes a command

    The wrapper checks the profile and workspace, then finds a matching YOLO grant.

  4. Pipal core → Tool router · Run tool

    Core passes the call through without a card

    The host router rechecks the pinned binding and dispatches Bash to the selected location.

Restart

  1. Pipal core → Pi Durable · Park 1

    The call is already waiting

    The park has a signal key and no expiry time.

  2. Pipal core → Pi Durable · Reopen store

    Pipal restarts with the same workspace available

    Recovery finds the saved call still sleeping and leaves it there.

  3. Hono → Browser · Same card

    You return to the same request

    The task ID and park are unchanged. Time spent offline counts as part of the wait.

  4. Browser → Hono · Approve 1

    You decide the original request

    The browser submits the saved task ID and park.

  5. Hono → Pipal core · Check request

    Core checks the saved wait

    The same task is still waiting at park 1.

  6. Pipal core → Pi Durable · Deliver decision

    Pi receives the decision on the saved key

    Core credits the elapsed wait, including the time Pipal was down.

Stale request

  1. Pipal core → Pi Durable · Park 1

    The call asks under the original Docker scope

    The request belongs to the image and volume that were configured when the tool asked.

  2. Hono → Browser · Stale card

    Pipal restarts with a replacement image

    The snapshot marks the original request stale. The card still lets you send a decision.

  3. Browser → Hono · Approve 1

    You click Approve on the old request

    The browser sends the same task ID and park.

  4. Hono → Pipal core · Check request

    Core checks that the old park is still waiting

    The HTTP handler passes the decision to Core for the conversation, task, park and abort checks.

  5. Pipal core → Pi Durable · Deliver decision

    Core signals park 1

    A stale binding still allows delivery if the original request is waiting and has no abort requested.

  6. Pi Durable → Pipal core · Wake

    The wrapper checks the pin again

    The replacement image changes the scope. The chat’s pinned scope no longer matches, so the wrapper has no current workspace binding.

  7. Pipal core → Pi Durable · Tool error

    The command ends before reaching Docker

    Start a new chat to use the replacement workspace.

Browser
Hono app.ts
Pipal core index.ts
Pi Durable
Tool router

Pi Durable → Pipal core

Developer proposes a command

Pipal checks that Developer has the tool and that the chat has a current workspace.

Follow one Bash call through the gate. Switch scenarios to see what changes when you deny it, enable YOLO, or restart Pipal.

The card asks for workspace approvalA decision to allow or deny one proposed workspace action before it runs., your decision on one proposed action. Pipal puts a check around each tool in pipal.coding and pipal.bash before handing control to the implementation. The wrapper checks the profile’s grant, the chat’s pinned locationThe place a chat uses for project tools, either the Pipal host, an account reached over SSH, or a Docker project. and project scope, and whether the location supports the tool. The read tool goes through the binding check without asking for approval. That’s how Developer can look through a file and still have to stop before editing it. index.ts workspace-locations.ts

A decision covers the workspace identity Pipal used when the tool asked. Pipal represents that identity with a fingerprint called a workspace scopeA fingerprint Pipal uses to tie a permission to a particular workspace.. boundWorkspace() looks up the backend at the pinned location and checks the scope there. A replacement workspace can have a different scope even if you still call it by the same name. index.ts

Workspace approval covers edit, write, bash, publish_file, and git_clone when enabled. For publish_file, you approve copying the named project file into the chat as a download. Files in, artifacts out follows that copy. index.ts project-coding.ts

Public web lookups run outside the project. With the relevant grants, Developer can use provider-hosted search, ask Exa to search, or ask Jina Reader for a page. Those calls do not open a workspace approval card. index.ts public-web.ts

Read the tool name and the arguments together. The card shows the full arguments in a scrollable box and tells you when more text sits below the fold. For a multiline command, file contents or an edit, Read multiline arguments gives you a second view so you can read the lines as lines. The complete argument box stays available for checking the other fields. WorkspaceApproval.svelte approval-text.ts

Choose Approve and Pipal wakes the call to check the decision against the current workspace. When a call wakes in the wrapper after Deny, it throws a tool error saying that you denied the action before checking workspace access. The model can use that result in the rest of the reply. The Docker project and The development workspace show where tools that pass the check execute. index.ts README.md

The request can wait for you

If you shut Pipal down while the card is on screen, the wait is already saved. If the same workspace is available after restart, you can decide from the same card. The time Pipal was down counts as time spent waiting. The core runtime explains how the rest of a reply’s deadline works. runtime.test.ts

The browser refreshes the sidebar’s Needs approval markers while the page is visible and the sidebar can be seen. It uses GET /api/v1/conversations/awaiting-approval. When a delegated specialist asks, look in the parent chat for its card. The decision still belongs to the conversation that made the call. App.svelte workspace.spec.ts

Illustration of one approval in a snapshot
{
  "taskId": "47",
  "park": 1,
  "arguments":
    "{\n  \"command\": \"pwd\"\n}"
}
  1. Tool task

    The ID goes in the decision URL. It stays the same when this call asks again.

  2. Request number

    The browser sends this in the body. It identifies the particular wait the card shows.

  3. Review text

    The card shows this string as indented JSON. Pipal escapes hidden characters for display.

{
  ,
  ,
  

}

1 Tool task

The ID goes in the decision URL. It stays the same when this call asks again.

An example of the approval object inside a live tool entry. The browser sends the task ID and park back with your decision.
Deep diveHow a click wakes exactly the request you saw

The wrapper writes the workspace scope, indented JSON arguments, request time and park number into the slot’s details in pi.live. It returns a sleep and a checkpoint containing the scope and count. The pipal.workspace-decision signal uses a key formed from the scope and the count, <scope>#<n>. Each signal key can be used once per task. The count lets a call ask again even if the workspace changes back to one it already asked under. index.ts workspace-approval.ts

approvalRequests() builds the public requests from sleeping slots. snapshot() puts each at liveTools[].approval. The request can also include hiddenCharacters: true and stale: true. A legacy call that slept on the bare scope comes through as park 0. The current format starts at park 1. waitingForApproval() scans sleeping tasks for the decision signal, skips tasks marked for abort, and uses the owner’s conversation ID for child requests. index.ts workspace-approval.ts view.ts

The browser posts {allow, park} to POST /api/v1/conversations/:id/workspace-approvals/:task. In approveWorkspace(), the admission queue orders the decision alongside new inputs and deadline aborts. In one commit, the handler verifies that the tool task belongs to that conversation, has no abort requested and still sleeps on the specified park. Then it delivers the signal and extends the deadline by the time since the request. For a delegated specialist, it credits the parent’s deadline. An independent worker gets the time back on its own deadline. app.ts index.ts

A changed request, or one that is no longer awaiting approval in that conversation, gets HTTP 409. An invalid task ID or missing conversation gets HTTP 404. After delivery, Pipal checks the updated deadline. If the submission is still placed and has time left, Pipal re-arms its timer. The decision handler does not send the resumed run through admission again. On wake, the wrapper clears the saved approval details when it reads a decision. index.ts

A decision belongs to the workspace you reviewed

In This machine and SSH machine, the scope fingerprints the account and project directory. In Docker, the scope fingerprints the image, volume and clone permission. Picture a Docker image being replaced while a command is waiting. The command text can stay identical while the programs it calls change. On restart Pipal can show the old request as stale, and the chat stays pinned to its original scope. project-shell.ts index.ts

When the owner disables a location in Settings → Workspace, interruptLocations() aborts runs with waiting workspace requests there. A connection failure can leave a request waiting at an enabled location. Approve can still wake the call, which fails its binding check if the workspace remains unavailable. For a connection failure, use Retry connection in the Workspace tab and wait for the chat’s pinned workspace to become available before approving. index.ts DeveloperWorkspace.svelte

Deep diveWhat changes the workspace scope

In createProjectTools(), the Docker SHA-256 hash combines the image ID, the volume name and its creation time, plus a git_clone marker when network clones are enabled. The creation time distinguishes two volumes created under the same name. project-shell.ts

For a persistent project, scoped() uses SHA-256 to hash the transport (local or ssh), host, user, project ID and the identity returned by the runner. This machine uses local as the host value and the Pipal account name as the user. SSH machine uses the configured host and account. The runner’s identity includes a machine ID (the platform UUID on macOS and /etc/machine-id on Linux), numeric user ID, canonical directory path, device, inode and directory birth time in nanoseconds. The runner rechecks that identity before running commands or file operations. development-workspace.ts development-runner.mjs

boundWorkspace() requires the named project and its saved scope to match at the pinned location. For Docker, it checks the workspace scope. pinnedScope() can recover it for an older Docker chat from its YOLO grant or the scope recorded when the migrated location first opens. projectScope() gives the wrapper a scope only when that binding is current and the profile has workspace access directly or through delegation. index.ts

On wake, the wrapper first handles a denial, then checks the current extension grant and workspace binding. For a call bound to a current workspace, the gate compares two possible permissions against that scope. One comes from YOLO, the other from a decision. A decision for another scope cannot supply that permission. A matching YOLO grant can still let the call run. With neither match, the wrapper saves a fresh request before the original implementation can run.

packages/core/src/index.ts
const gate = tool.name === 'read' ? undefined : bound;
let toolContext = bound ? withContextValue(developmentProject, bound, ctx) : ctx;
if (bound && location && location !== 'none')
toolContext = withContextValue(executionLocation, location, toolContext);
// An approval given under a previous workspace never runs here: the call asks again, on a key of its own.
if (gate !== undefined && autoScope !== gate && decided?.scope !== gate) {
// The details name the park, so a decision applies only to the request that the user saw.
const park = { workspaceScope: gate, parks: (parked?.parks ?? 0) + 1 };
await api.details({
workspaceScope: gate,
arguments: JSON.stringify(args, null, 2),
requestedAt: clock.now(),
park: park.parks
}, ctx);
return { kind: 'sleep', signals: [approvalKey(park)], checkpoint: park };
}
return tool.execute(args, api, withContextValue<ToolTime>(workspaceToolTime,
(limitMs, operation) => runOnToolTime(api, ctx, limitMs, operation), toolContext));
index.ts

YOLO gives one chat permission to keep going

When you want Developer to work through several commands and edits without pausing at each one, open Runtime → Workspace approvals and choose YOLO in this chat. YOLOA saved permission to skip the approval prompt for actions in a matching workspace scope. is advance approval for eligible calls in that chat’s current workspace. The composer shows a YOLO badge while the grant applies. You can choose the setting while creating a chat or change it between replies. On This machine, Bash still runs as the Pipal service user and can read that account’s files, including chats and the saved model login. RuntimePicker.svelte DeveloperWorkspace.svelte

To start future workspace chats this way, open Settings → Workspace, select Start new chats in YOLO mode, and save. The setting starts off. You can still choose Ask before edits and commands for an individual draft. The browser remembers that choice across a reload and sends the mode shown in the composer when it creates the chat. Existing chats keep their own approval settings. App.svelte workspace.spec.ts

Switching to a different profile clears the saved grant. Changing the workspace scope makes a grant for the old scope inapplicable, even if you return to the same chat after restarting Pipal. A newly delegated specialist inherits YOLO when the parent’s scope still matches and the specialist’s profile has a workspace tool grant. index.ts

Runtime locks profile and approval changes while a reply is active. Before changing these settings, let the reply finish or press Stop. If the pinned workspace is unavailable, the Workspace approvals selector stays disabled even in an idle chat when the profile still shows that field. App.svelte RuntimePicker.svelte

An approval can wait until you return, but the build you approve may need longer than a reply. How can the assistant come back to the same build from another reply? Workers follows the conversation Pipal keeps for that job.

Recap

  • Project tools first check the profile grant and workspace binding. Eligible calls other than read need an approval or a matching YOLO grant.
  • A decision names both a tool task and its current park, and waiting time is credited back to the reply.
  • The pinned location and workspace scope tie the permission to the workspace you reviewed. Disabling that location cancels a pending request there.
Check yourself
  1. You reload the chat after Pipal has been offline overnight. The same workspace is available. What can you do with the pending card?
    • Approve or deny the original request
    • Ask the model to repeat the command because the card expired
    • Read the card as a record of a command that already ran
    Answer and explanation

    Approve or deny the original request

    Pi keeps the sleeping task and its signal key. The approval wait has no expiry of its own.

  2. The owner disables a location while a command is waiting. You still have the card open when the settings change finishes. What happens if you click Approve?
    • The old card lets the command run
    • Core rejects the decision with 409
    • Pipal runs it at the new default location
    Answer and explanation

    Core rejects the decision with 409

    Disabling the location aborts the waiting run. The old park can no longer accept a decision, and the chat stays pinned to its original location.

  3. The workspace starts new chats in YOLO mode. In a new Developer draft you choose Ask before edits and commands, reload the tab, then send. What happens when Developer proposes publishing a file?
    • The workspace default approves the call
    • Reloading the draft approves the call
    • The chat asks for approval
    Answer and explanation

    The chat asks for approval

    The draft remembers your explicit choice. The chat starts in Ask mode, and publishing a project file requires approval in that mode.

  1. You reload the chat after Pipal has been offline overnight. The same workspace is available. What can you do with the pending card?

  2. The owner disables a location while a command is waiting. You still have the card open when the settings change finishes. What happens if you click Approve?

  3. The workspace starts new chats in YOLO mode. In a new Developer draft you choose Ask before edits and commands, reload the tab, then send. What happens when Developer proposes publishing a file?

In the source

Book contents

Search the book