Argus Mode with Custom Hostname

Akto Guardrails for Claude CLI (Argus mode) provides security validation and observability for AI interactions on servers and shared environments. It intercepts prompts, responses, and MCP tool calls, validates them against security policies, blocks risky behavior, and reports all events to your Akto dashboard under Agentic AI.

Key Features

  • Zero Installation - No standalone apps to install

  • Transparent Integration - Uses Claude CLI's native hook mechanism

  • Real-time Protection - Validates every prompt, response, and MCP tool call

  • Centralized Monitoring - All events reported to Akto dashboard under Agentic AI

  • Custom Hostname - Override the default api.anthropic.com host via AKTO_HOST

  • Configurable Behavior - Blocking or observation-only modes

How It Works

Claude CLI's hook system executes custom scripts at four critical points:

4 Hook Points:

  1. UserPromptSubmit — Validates prompts before sending to Claude API

  2. PreToolUse — Validates MCP tool input before execution

  3. PostToolUse — Captures MCP tool results for observability and response guardrails

  4. Stop — Validates responses when Claude finishes generating

File Structure

Key Files:

  • Wrapper scripts (.sh): Set environment variables, invoke Python scripts

    • ⚠️ Contains {{AKTO_DATA_INGESTION_URL}}, {{AKTO_TOKEN}}, {{AKTO_HOST}} placeholders — must be replaced with your real values

  • Python scripts (.py): Core validation logic and Akto API communication

  • akto_helpers.py: Provides get_device_ip() (LAN IP used in the ip payload field)

  • settings.json: Links Claude CLI hook events to wrapper scripts

Setup Guide

Prerequisites

Installation Steps

1

Create Directories

2

Download Hook Scripts

3

Configure Akto Ingestion URL ⚠️ CRITICAL STEP

circle-exclamation

Automated replacement:

Manual replacement (alternative):

Edit each wrapper script and replace:

With:

Files to update:

  • akto-validate-prompt-wrapper.sh

  • akto-validate-response-wrapper.sh

  • akto-validate-mcp-request-wrapper.sh

  • akto-validate-mcp-response-wrapper.sh

4

Configure Hooks

Create Claude CLI settings configuration:

5

Configure Token and Host

AKTO_HOST becomes the host request header value in every mirrored payload.

6

Configure Hook Behavior (Optional)

Edit wrapper scripts to customize:

Sync Mode:

  • true: Validates and blocks threats in real time

  • false: Reports events to Akto but allows all traffic through

7

Verify Installation

Check logs to confirm hooks are working:

A successful Argus mode entry looks like:

Complete Wrapper Script Example

A fully configured Argus mode wrapper script:

Configuration Reference

Variable
Required
Default
Description

AKTO_DATA_INGESTION_URL

Yes

Your Akto instance URL

AKTO_TOKEN

Yes

Authorization token for Akto API

AKTO_HOST

No

https://api.anthropic.com

host header value in mirrored requests

CONTEXT_SOURCE

No

AGENTIC

Payload contextSource field and tags["source"] value

AKTO_SYNC_MODE

No

true

true = blocking, false = observe only

AKTO_TIMEOUT

No

5

Request timeout in seconds

AKTO_CONNECTOR

No

claude_code_cli

Connector identifier in the dashboard

LOG_DIR

No

~/.claude/akto/logs

Directory for log files

LOG_LEVEL

No

INFO

Logging verbosity: DEBUG, INFO, WARNING, ERROR

LOG_PAYLOADS

No

false

Log full request/response payloads

Environment Variables (Optional)

Override wrapper script values via shell environment:

Troubleshooting

Hooks Not Executing

Ingestion URL Not Configured

Custom Hostname Not Appearing in Logs

Events Not in Dashboard

Check Logs for Errors

Hooks Not Blocking Threats

Ensure AKTO_SYNC_MODE is true:

Uninstallation

Complete Removal

Selective Removal (Keep Logs)

Backup Before Removal

Verify Removal

Enterprise Deployment

Automated Deployment Script

Deploy to a server or shared environment:

Quick Setup Summary

Resources

Last updated