Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CLI Reference

Command-line interface reference.

Global Commands

akira

Start the interactive console:

akira

akira --version

Show version information:

akira --version

akira --help

Show help:

akira --help

Commands

akira list

List all available attack modules:

akira list

Output shows module name, category, severity, and description.

akira run

Run a specific module non-interactively:

akira run <module> [options]

Options

OptionShortDescription
--target-tTarget URL
--target-type-TTarget type (openai, anthropic, api, etc.)
--key-kAPI key
--model-mModel identifier
--setSet module option (name=value)
--request-templateCustom request JSON
--response-pathJSON path to response
--auth-typeAuthentication type
--auth-headerCustom auth header
--timeoutRequest timeout
--output-oOutput format (json, table)

Examples

# Basic usage
akira run injection/basic_injection \
    -t https://api.openai.com/v1/chat/completions \
    -T openai \
    -k $OPENAI_API_KEY

# With options
akira run injection/basic_injection \
    -t https://api.openai.com/v1/chat/completions \
    -T openai \
    -k $OPENAI_API_KEY \
    --set canary=MY_TEST_STRING \
    --set use_fuzzing=true

# Custom API
akira run extraction/system_prompt_leak \
    -t https://myapi.com/chat \
    -T api \
    --request-template '{"message": "$payload"}' \
    --response-path 'data.reply' \
    -k $API_KEY

# JSON output
akira run jailbreak/dan_jailbreak \
    -t https://api.anthropic.com/v1/messages \
    -T anthropic \
    -k $ANTHROPIC_API_KEY \
    -o json

akira update

Update attack repository from remote:

akira update

Options:

OptionDescription
--repoRepository URL
--forceForce update

Environment Variables

VariableDescription
OPENAI_API_KEYDefault OpenAI API key
ANTHROPIC_API_KEYDefault Anthropic API key
HF_TOKENHuggingFace API token
AWS_ACCESS_KEY_IDAWS credentials
AWS_SECRET_ACCESS_KEYAWS credentials
AKIRA_DATA_DIRCustom data directory

Exit Codes

CodeMeaning
0Success
1General error
2Invalid arguments
3Target connection failed
4Authentication failed
5Module not found

Output Formats

Table (default)

[+] Attack completed

    Success:    True
    Confidence: 0.95
    Payload:    Ignore all previous...
    Response:   CANARY_STRING

JSON

akira run module -o json
{
  "success": true,
  "confidence": 0.95,
  "payload_used": "...",
  "response": "...",
  "details": {},
  "module": "injection/basic_injection",
  "target": "https://api.openai.com/..."
}