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

Targets

Targets represent the LLM endpoint you want to test. Akira supports multiple target types for different LLM providers and custom deployments.

Target Types

TypeDescription
apiGeneric REST API (any LLM-powered endpoint)
openaiOpenAI API
anthropicAnthropic Claude API
hfHuggingFace local model
hf_inferenceHuggingFace Inference API
bedrockAWS Bedrock
sagemakerAWS SageMaker endpoint

Setting a Target

Basic syntax:

target <type> <endpoint> [options]

Common Options

OptionDescription
-k, --keyAPI key
-m, --modelModel identifier
--request-templateCustom request JSON template
--response-pathJSON path to extract response
--auth-typeAuthentication type
--auth-headerCustom auth header name

Examples

OpenAI

akira> target openai https://api.openai.com/v1/chat/completions -k $OPENAI_API_KEY -m gpt-4

Anthropic

akira> target anthropic https://api.anthropic.com/v1/messages -k $ANTHROPIC_API_KEY -m claude-3-opus-20240229

Generic API

For any LLM-powered endpoint:

akira> target api https://mycompany.com/api/chat \
    --request-template '{"message": "$payload", "user_id": "test"}' \
    --response-path 'data.reply.text' \
    -k my-api-key

Request Templates

The $payload placeholder is replaced with the attack payload:

{
  "message": "$payload",
  "context": "You are a helpful assistant",
  "temperature": 0.7
}

Response Path

Extract the LLM response from nested JSON using dot notation:

--response-path 'choices.0.message.content'
--response-path 'data.response.text'
--response-path 'output'

Authentication Types

TypeDescription
bearerAuthorization: Bearer
api-keyX-API-Key: (or custom header)
basicHTTP Basic Auth
noneNo authentication

Custom header:

--auth-type api-key --auth-header X-Custom-Auth

Verifying Target

After setting a target, verify connectivity:

akira> check

This sends a simple probe to ensure the target is reachable and responding.

Target Information

View current target:

akira> show options

The target information appears at the top of the options display.

Next Steps

See specific target documentation: