Documentation

Everything you need to set up and use Askance with your coding agents.

Quick Start

Get Askance running in under 60 seconds.

1. Install the CLI

Terminal
npm install --save-dev @askance/cli

2. Initialize your project

Terminal
npx askance init

This creates .askance/config.json (settings), configures .claude/settings.json (hooks + MCP server), and adds Askance instructions to CLAUDE.md.

3. Log in

Terminal
npx askance login

Opens your browser for OAuth sign-in (GitHub, Google, or Microsoft). Your credentials are saved locally to .askance/credentials.

4. Restart your Claude session

Hooks and MCP tools are loaded at session start. Restart Claude Code or Claude Desktop to pick up the new configuration.

That's it! Open https://app.askance.app to see your dashboard. Any tool calls your agent makes will now show up for approval.

VS Code + Claude Code Setup

Step-by-step guide for using Askance with the Claude Code extension in VS Code.

Prerequisites

  • VS Code with the Claude Code extension installed
  • Node.js 18+ and npm
  • A project directory where Claude Code is active

Step 1: Install @askance/cli

npm install --save-dev @askance/cli

Installs the Askance CLI as a development dependency. This includes the hook handler, MCP server, and CLI tools.

Step 2: Initialize configuration

npx askance init

This creates a config file and configures hooks in your Claude settings:

.askance/config.json
{
  "apiUrl": "https://api.askance.app",
  "projectId": "",
  "keepAlive": {
    "enabled": true,
    "duration": 3600,
    "pollInterval": 30
  }
}

Policy rules are managed via the dashboard, not locally. The hooks config:

.claude/settings.json
{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "^(?!mcp__askance__).*",
        "hooks": [
          {
            "type": "command",
            "command": "node \"node_modules/@askance/cli/dist/hook-handler/index.js\"",
            "timeout": 120
          }
        ]
      }
    ],
    "Stop": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "node \"node_modules/@askance/cli/dist/hook-handler/stop-hook.js\"",
            "timeout": 10
          }
        ]
      }
    ]
  },
  "mcpServers": {
    "askance": {
      "command": "node",
      "args": ["node_modules/@askance/cli/dist/mcp-server/index.js"]
    }
  }
}

Step 3: Log in

npx askance login

Opens your browser for OAuth sign-in. Your credentials are saved to .askance/credentials and your project is linked automatically.

Step 4: Restart Claude Code session

Claude Code loads hooks and MCP servers at session start. After configuring Askance, restart your Claude Code session so it picks up the new hooks.

Important: Hooks and MCP servers load at session start. If you don't restart, Claude Code won't use the Askance hooks. You can restart by closing and reopening the Claude Code panel in VS Code.

How it works

When Claude Code tries to use a tool (like running a Bash command or editing a file):

  1. The PreToolUse hook intercepts the tool call and sends it to the Askance cloud API
  2. The API evaluates it against your policy rules configured in the dashboard
  3. If the rule says allow, it proceeds immediately
  4. If the rule says gate, it appears in your dashboard for approval
  5. If the rule says deny, it's blocked automatically
  6. You approve or deny from any device — the agent continues based on your decision

Claude Desktop (Claude for Work)

Askance works with Claude Desktop's local tool execution, including Claude for Work deployments.

How it works with Claude Desktop

Claude Desktop can execute local tools on your machine. When configured with Askance, the same hook system intercepts these tool calls before execution.

  • The hook handler intercepts tool calls and routes them to the daemon
  • The MCP server provides tools for the agent: wait, pending, status, check_instructions
  • Keep-alive polling prevents timeouts during long sessions

Configuration

The same .claude/settings.json configuration applies. Run npx askance init in your project directory and Claude Desktop will pick up the hooks when executing local tools.

MCP Tools Available to Claude

When the MCP server is configured, Claude gets these additional tools:

ToolDescription
askance_waitBlocks until a pending approval is decided
askance_pendingLists all pending approvals
askance_statusReturns daemon health and connection status
askance_check_instructionsChecks for new instructions from the dashboard

Claude for Work

If your organization uses Claude for Work, the same setup applies. Askance works with any Claude client that supports hooks and MCP servers for local tool execution. Speak with your IT admin about configuring .claude/settings.json in your approved project templates.

Cursor IDE Setup

Askance integrates with Cursor IDE using the same PreToolUse hook mechanism available in Claude Code.

Prerequisites

  • Cursor IDE installed
  • Node.js 18+ and npm
  • A project directory where Cursor's AI agent is active

Step 1: Install @askance/cli

npm install --save-dev @askance/cli

Step 2: Initialize with Cursor configuration

npx askance init --cursor

This creates .cursor/settings.json with hook and MCP server configuration:

.cursor/settings.json
{
  "cursor.hooks": {
    "preToolUse": {
      "command": "node",
      "args": ["node_modules/@askance/cli/dist/hook-handler/index.js"],
      "matchTools": [".*"],
      "excludeTools": ["mcp__askance__.*"]
    }
  },
  "cursor.mcp": {
    "servers": {
      "askance": {
        "command": "node",
        "args": ["node_modules/@askance/cli/dist/mcp-server/index.js"]
      }
    }
  }
}

Step 3: Log in

npx askance login

Authenticates with Askance and links your project.

Step 4: Restart Cursor

Restart Cursor to load the hooks and MCP server. After restarting, Cursor's AI agent will route all tool calls through Askance for policy evaluation.

Important: Hooks and MCP servers load at startup. Make sure to restart Cursor after running npx askance init.

How it works

Askance hooks into Cursor's tool execution pipeline using the same PreToolUse hook mechanism used for Claude Code:

  1. The hook handler intercepts the tool call and sends it to the Askance cloud API
  2. The policy engine evaluates your project's rules
  3. If gated, the approval appears in your Askance dashboard
  4. You approve or deny from any device — web, desktop, or mobile

GitHub Copilot Setup

Askance can integrate with GitHub Copilot's coding agent to provide approval workflows for tool calls made during Copilot agent sessions.

Step 1: Install @askance/cli

npm install --save-dev @askance/cli

Step 2: Initialize with Copilot configuration

npx askance init --copilot

This creates .github/copilot-config.json with hook configuration:

.github/copilot-config.json
{
  "copilot.agent": {
    "hooks": {
      "preToolUse": {
        "command": "node",
        "args": ["node_modules/@askance/cli/dist/hook-handler/index.js"],
        "matchTools": [".*"]
      }
    }
  }
}

Step 3: Log in

npx askance login

Authenticates with Askance and links your project.

How it works

When GitHub Copilot's agent attempts to execute tools (file edits, terminal commands, etc.), Askance intercepts the call and routes it through the Askance cloud API for evaluation against your policy rules.

Limitations

  • GitHub Copilot agent workflow support is evolving; check GitHub's documentation for the latest hook API
  • Some Copilot operations may bypass local hooks when running in GitHub's cloud environment

Multi-Agent Setup

Need to configure Askance for multiple agents at once? Use npx askance init --all to set up Claude Code, Cursor, and GitHub Copilot configurations in a single command.

Policy Configuration

Control how Askance handles each tool call using policy rules managed via the dashboard or CLI templates.

Rule Structure

Each rule has a name, regex patterns for tool and command matching, an action, and a risk level. Rules are evaluated top-to-bottom; the first match wins.

Rule fields
{
  "Name": "Human-readable rule name",
  "ToolPattern": "^Bash
quot;, // Regex matching tool name "CommandPattern": "npm (test|run)", // Regex matching command/input (optional) "Action": "Allow", // Allow | Gate | Deny "Risk": "Low" // Low | Medium | High }

Rules are managed via the dashboard or by applying a template: npx askance template moderate

Actions

allowTool call proceeds immediately without user approval. Use for safe, read-only operations.
gateTool call is paused and shown in the dashboard. Requires explicit approval or denial.
denyTool call is blocked automatically. Use for dangerous operations.

Risk Levels

Risk levels are informational — they help you understand the danger level at a glance in the dashboard.

low — Read operations, status checks
medium — File writes, code changes
high — Shell commands, git operations, destructive actions

Policy Templates

Apply a pre-built set of rules with a single command:

Terminal
npx askance template moderate

Available templates:

conservativeGate all writes and bash, deny destructive commands
moderateAllow safe reads and test/build, gate the rest (recommended)
permissiveAllow everything, deny only destructive commands
ci-safeMinimal permissions for CI/CD environments

You can also create and edit individual rules in the dashboard.

Keep-Alive Configuration

The keep_alive section controls how the MCP server maintains the connection. poll_interval sets how often it pings the API (default: 30 seconds), and duration sets the total keep-alive time (default: 3600 seconds / 1 hour).

Dashboard Guide

The web dashboard is your control center for managing agent approvals and instructions.

Approval Cards

Each pending tool call appears as an approval card showing:

  • Tool name and risk level (color-coded badge)
  • Tool input (command, file path, or content preview)
  • Context summary from the agent's recent work
  • Timestamp and time elapsed

You can:

  • Approve — let the tool call proceed
  • Deny — block the tool call
  • Other — provide a custom response or instruction
  • Approve Always — approve and create an auto-approval rule

Sending Instructions

Each project panel has an instruction input field. Type a message and send it — the agent will pick it up via the MCP server's check_instructions tool. Use this to redirect the agent, provide clarification, or adjust priorities without waiting for a tool call.

Multi-Project View

The dashboard supports monitoring up to 4 projects simultaneously in a grid layout. Select projects from the dropdown in each panel. Real-time updates sync across all panels via SignalR.

Audit Log

The audit log shows a complete history of every tool call, including the decision made, which policy rule matched, timestamps, and risk levels. Filter by project and paginate through history.

API Reference

The Askance cloud API is hosted at api.askance.app. All endpoints require authentication via JWT bearer token.

MethodEndpointDescription
POST/api/interceptSubmit a tool call for policy evaluation
GET/api/approvalsList pending approvals
POST/api/approvals/:id/decideApprove or deny a tool call
GET/api/approvals/:id/waitLong-poll for approval decision
GET/api/queueGet current approval queue
GET/api/projectsList projects
POST/api/projectsCreate a project
GET/api/rules/:projectIdGet project rules
PUT/api/rules/:projectIdUpdate project rules
GET/api/rules/globalGet global rules
PUT/api/rules/globalUpdate global rules
GET/api/audit/:projectIdGet audit log entries
POST/api/instructions/:projectIdSend instruction to agent
GET/api/instructions/:projectId/waitLong-poll for new instructions
GET/api/settingsGet user settings
PUT/api/settingsUpdate user settings
GET/api/healthHealth check

CLI Commands

npx askance init

Initializes Askance in the current project. Creates .askance/config.json (settings), configures agent hooks and MCP server, and adds Askance instructions to CLAUDE.md.

Options: --cursor (Cursor IDE), --copilot (GitHub Copilot), --all (all agents).

npx askance login

Authenticates with the Askance cloud service. Opens your browser for OAuth sign-in (GitHub, Google, or Microsoft). Saves credentials to .askance/credentials and links your project automatically.

npx askance template <name>

Applies a pre-built policy template to your project. Available templates: conservative, moderate, permissive, ci-safe.

npx askance help

Shows CLI usage information and available commands.