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.comhost viaAKTO_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:
UserPromptSubmit— Validates prompts before sending to Claude APIPreToolUse— Validates MCP tool input before executionPostToolUse— Captures MCP tool results for observability and response guardrailsStop— 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_API_TOKEN}},{{AKTO_HOST}}placeholders — must be replaced with your real values
Python scripts (
.py): Core validation logic and Akto API communicationakto_ingestion_utility.py: Shared validation/ingestion logic imported by every hook script — lives in a different GitHub directory (shared/, notclaude-cli-hooks-argus/), so it needs its own download stepakto_helpers.py: Providesget_device_ip()(LAN IP used in theippayload field)settings.json: Links Claude CLI hook events to wrapper scripts
Setup Guide
Prerequisites
Claude CLI installed (Installation Guide)
Akto instance URL and token
Python 3.7+
macOS, Linux, or Windows with bash/zsh
Installation Steps
Create Directories
Download Hook Scripts
Configure Akto Ingestion URL ⚠️ CRITICAL STEP
All wrapper scripts contain the placeholder {{AKTO_DATA_INGESTION_URL}} that must be replaced with your actual Akto instance URL.
Automated replacement:
Manual replacement (alternative):
Edit each wrapper script and replace:
With:
Files to update:
akto-validate-prompt-wrapper.shakto-validate-response-wrapper.shakto-validate-mcp-request-wrapper.shakto-validate-mcp-response-wrapper.sh
Configure Hooks
Create Claude CLI settings configuration:
Configure Token and Host
AKTO_HOST becomes the host request header value in every mirrored payload.
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
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
AKTO_DATA_INGESTION_URL
Yes
—
Your Akto instance URL
AKTO_API_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
ModuleNotFoundError: No module named 'akto_ingestion_utility'
The shared ingestion utility was not downloaded, or landed outside ~/.claude/hooks/. It lives in the shared/ directory on GitHub, not under HOOKS_BASE, so it needs its own curl.
If the file is present and the import still fails, check that PYTHONSAFEPATH is unset — it suppresses the script-directory entry on sys.path that this import relies on.
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
Support: support@akto.io
Community: https://www.akto.io/community
Last updated