Skip to content

claude hooks custom hostname#4927

Open
DharunThota wants to merge 2 commits intoakto-api-security:masterfrom
DharunThota:feat/claude-hooks-custom-hostname
Open

claude hooks custom hostname#4927
DharunThota wants to merge 2 commits intoakto-api-security:masterfrom
DharunThota:feat/claude-hooks-custom-hostname

Conversation

@DharunThota
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings April 23, 2026 07:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for overriding the host request header used by the Claude CLI hook ingestion/validation payloads, enabling custom hostname reporting independent of CLAUDE_API_URL.

Changes:

  • Add AKTO_HOSTNAME env var support to override the host header in request payloads (non-MCP paths).
  • Update .env.example with MODE, DEVICE_ID, and AKTO_HOSTNAME documentation and clarify CLAUDE_API_URL behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
apps/mcp-endpoint-shield/claude-cli-hooks/akto-validate-response.py Allow overriding host header via AKTO_HOSTNAME.
apps/mcp-endpoint-shield/claude-cli-hooks/akto-validate-prompt.py Allow overriding host header via AKTO_HOSTNAME.
apps/mcp-endpoint-shield/claude-cli-hooks/akto-validate-mcp-response.py Allow overriding host header via AKTO_HOSTNAME for non-MCP traffic.
apps/mcp-endpoint-shield/claude-cli-hooks/akto-validate-mcp-request.py Allow overriding host header via AKTO_HOSTNAME for non-MCP traffic.
apps/mcp-endpoint-shield/claude-cli-hooks/.env.example Document MODE, DEVICE_ID, AKTO_HOSTNAME; clarify CLAUDE_API_URL usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +131 to 132
host = os.getenv("AKTO_HOSTNAME") or CLAUDE_API_URL.replace("https://", "").replace("http://", "")

Comment on lines +129 to 130
host = os.getenv("AKTO_HOSTNAME") or CLAUDE_API_URL.replace("https://", "").replace("http://", "")

Comment on lines +216 to 217
host = os.getenv("AKTO_HOSTNAME") or CLAUDE_API_URL.replace("https://", "").replace("http://", "")

Comment on lines +216 to 217
host = os.getenv("AKTO_HOSTNAME") or CLAUDE_API_URL.replace("https://", "").replace("http://", "")

AKTO_SYNC_MODE=true
MODE=argus # Optional: "argus" (default) or "atlas" for device-scoped URL format
DEVICE_ID= # Optional: overrides auto-detected machine id (used in atlas mode)
AKTO_HOSTNAME= # Optional: overrides the "host" request header; falls back to host derived from CLAUDE_API_URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants