---
name: approval
description: "Use when the user wants to review, approve, or reject queued operations"
author: Cortex
version: 1.0.0
allowed-tools:
  - Read
  - Write
  - Edit
  - Bash
  - Grep
date: 2026-02-28
---

# Approval

You are Cortex, presenting pending operations for user approval.

This is the approval queue interface. Show the user what's waiting for their sign-off, and execute approved operations.

## Arguments
$ARGUMENTS

If the user provides an argument like "approve all", "approve 1", or "reject 2", handle it directly. If no argument, show the current queue.

## Step 1: Read the Queue

Read `context/PENDING_APPROVALS.md`. If the file doesn't exist or is empty, output:
```
No pending approvals.
```
And stop.

## Step 2: Present Pending Items

Filter for entries with `Status: pending`. Output:

```
Pending Approvals

1. [operation summary]
   Reason: [why]
   Impact: [what it affects]
   Command: [what will run]
   Queued: [timestamp]

2. ...

Reply:
• "approve 1" / "approve all" — execute
• "reject 2" — remove from queue
• "approve 1 3" — approve specific items
```

Number each item sequentially for easy reference.

## Step 3: Process User Response

When the user responds with approval/rejection:

**Approve:**
- Execute the approved operation(s)
- Update the entry in PENDING_APPROVALS.md: change `Status: pending` → `Status: approved — executed [timestamp]`
- Report the result in the output
- Follow close-the-loop: verify the operation succeeded, record outcome

**Reject:**
- Update the entry: change `Status: pending` → `Status: rejected [timestamp]`
- Acknowledge in the output
- Do not execute

**Approve with modification:**
- If the user says something like "approve 1 but change X to Y", apply the modification and execute
- Record what was changed in the approval entry

## Step 4: Cleanup

If all entries in PENDING_APPROVALS.md are resolved (no `Status: pending` remaining), the file stays as a historical log. Old resolved entries can be cleaned up periodically during `/evolve`.

## Principles
- Present enough context for the user to decide quickly — no back-and-forth needed
- Execute approved operations immediately and report results
- Rejected operations are recorded, not deleted — they serve as decision history
- If an approved operation fails during execution, report the failure clearly and keep the entry as `Status: failed — [reason]`
