Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Shashank-H/gaiter-gaurd/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The GaiterGuard agent skill is a pre-packaged integration guide that teaches Claude how to interact with the gateway. It includes:
  • Complete protocol documentation (POST /proxy, polling, execute)
  • Polling script templates (Python and bash)
  • Request flow patterns and error handling
  • Risk scoring reference
With this skill installed, Claude can autonomously handle the full approval workflow without manual prompting.

Installation

1

Locate the skill directory

The skill is bundled in the GaiterGuard repository:
ls ~/workspace/source/skill/gaiterguard-gateway/
Contents:
skill/gaiterguard-gateway/
├── SKILL.md              # Main skill instructions
└── references/
    └── polling-script.md  # Polling script templates
2

Copy to Claude skills directory

Install the skill globally for Claude:
mkdir -p ~/.claude/skills
cp -r ~/workspace/source/skill/gaiterguard-gateway ~/.claude/skills/
If you’re using a different AI framework, adapt the installation path to your platform’s skill/tool directory.
3

Verify installation

The skill should now be available in Claude’s skill registry. You can verify by asking:
Do you have the gaiterguard-gateway skill installed?

Skill Contents

SKILL.md

The main skill file (~/workspace/source/skill/gaiterguard-gateway/SKILL.md:1) contains:
  • Environment variables required (GATEWAY_URL, AGENT_KEY)
  • Authentication header format
  • Workflow overview (submit → poll → execute)
  • Step-by-step protocol:
    • POST /proxy request format
    • 428 response handling
    • GET /status polling loop
    • POST /proxy/execute execution
  • Error code reference (401, 403, 404, 409, 410, 428, 502, 504)
  • Intent writing guidelines (good vs. bad examples)
  • Risk score baseline by HTTP method

Polling Script Template

The skill includes a complete polling script template (~/workspace/source/skill/gaiterguard-gateway/references/polling-script.md:1) with:
#!/usr/bin/env python3
import time, json, requests

GATEWAY_URL = "PLACEHOLDER_GATEWAY_URL"
AGENT_KEY   = "PLACEHOLDER_AGENT_KEY"
ACTION_ID   = "PLACEHOLDER_ACTION_ID"

ORIGINAL_REQUEST = {
    "targetUrl":      "PLACEHOLDER_TARGET_URL",
    "method":         "PLACEHOLDER_METHOD",
    "intent":         "PLACEHOLDER_INTENT",
    "riskScore":      0.0,
    "riskExplanation": "PLACEHOLDER_RISK_EXPLANATION",
}

POLL_INTERVAL = 8
MAX_POLLS     = 75

def poll():
    for attempt in range(MAX_POLLS):
        status_code, body = request("GET", f"/status/{ACTION_ID}")
        state = body.get("status")

        if state == "PENDING":
            time.sleep(POLL_INTERVAL)
            continue

        if state == "APPROVED":
            exec_code, exec_body = request("POST", f"/proxy/execute/{ACTION_ID}")
            return {
                "outcome": "executed",
                "status": exec_code,
                "body": exec_body,
                "original_request": ORIGINAL_REQUEST,
            }

        if state == "DENIED":
            return {"outcome": "denied", "original_request": ORIGINAL_REQUEST}

        if state == "EXPIRED":
            return {"outcome": "expired", "original_request": ORIGINAL_REQUEST}

        # ... (EXECUTED case)

    return {"outcome": "timeout", "original_request": ORIGINAL_REQUEST}
Key features:
  • Polls every 8 seconds for up to 75 attempts (~10 minutes)
  • Stores original request context (URL, method, intent, risk score)
  • Handles all status states (PENDING, APPROVED, DENIED, EXPIRED, EXECUTED)
  • Re-invokes agent with full context after execution

Using the Skill

Trigger Phrases

The skill activates when Claude detects:
  • “call an API through the gateway”
  • “proxy a request via GaiterGuard”
  • “use Agent-Key”
  • “POST /proxy”
  • Approval polling workflows
  • Any task requiring external API calls through the gateway

Example Usage

User:
Charge customer cus_123 for $50 using the Stripe API through the gateway.
Use Agent-Key: agt_a1b2c3...
Gateway URL: http://localhost:3000
Claude (with skill):
  1. Constructs POST /proxy request with proper headers
  2. Includes clear intent: “Charge customer $50.00 for service upgrade”
  3. Generates unique Idempotency-Key
  4. Submits request
  5. If 428 returned:
    • Writes polling script with placeholders filled in
    • Executes script
    • Waits for approval
    • Executes approved request
    • Returns result with original request context

Skill Metadata

From ~/workspace/source/skill/gaiterguard-gateway/SKILL.md:1-10:
---
name: gaiterguard-gateway
description: >
  Complete integration guide for AI agents making HTTP requests through the GaiterGuard API gateway.
  Use this skill whenever an agent needs to proxy requests to external/registered services via GaiterGuard.
  Covers Agent-Key authentication, constructing POST /proxy requests, handling risk-blocked 428 responses
  with a procedural polling loop, executing approved requests, and all response shapes.
  Trigger on: "call an API through the gateway", "proxy a request via GaiterGuard", "use Agent-Key",
  "POST /proxy", approval polling workflows, or any task requiring external API calls through the gateway.
---

Environment Variables

The skill requires two environment variables to be provided by the user:
GATEWAY_URL
string
required
Base URL of the GaiterGuard gateway instanceExample:
export GATEWAY_URL=http://localhost:3000
AGENT_KEY
string
required
The agent’s API key (obtained from dashboard)Example:
export AGENT_KEY=agt_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6...
Claude will prompt for these values if not set when the skill is triggered.

Benefits

Zero manual prompting

Claude automatically constructs proper requests, headers, and polling loops without needing step-by-step instructions each session.

Error handling

Built-in reference for all error codes (401, 403, 404, 409, 410, 428, 502, 504) with actionable recovery steps.

Context preservation

Polling scripts store and pass back original request context (URL, method, intent, risk score) so the agent can resume tasks correctly.

Copy-paste templates

Ready-to-run polling scripts in Python and bash with all placeholders filled in dynamically.

Customizing the Skill

You can modify the skill for your use case:
1

Edit SKILL.md

Update ~/.claude/skills/gaiterguard-gateway/SKILL.md to:
  • Change default polling interval (line 38: POLL_INTERVAL = 8)
  • Adjust max polls (line 39: MAX_POLLS = 75)
  • Add custom error handling
  • Include organization-specific rules
2

Modify polling scripts

Edit references/polling-script.md to:
  • Use your preferred HTTP library
  • Change logging format
  • Add Slack/email notifications on approval
  • Customize agent re-invocation command
3

Reload skill

Claude automatically picks up changes on next invocation. No restart required.

Skill Reference

Full skill documentation: ~/workspace/source/skill/gaiterguard-gateway/SKILL.md:1 Polling templates: ~/workspace/source/skill/gaiterguard-gateway/references/polling-script.md:1

Next Steps

Agent Integration

Manual integration guide (if not using Claude)

Configuration

Configure risk threshold and approval TTL

Build docs developers (and LLMs) love