Skip to main content

What you’ll build

By the end of this guide, you’ll have:
  • GaiterGuard running in Docker with a PostgreSQL database
  • A registered service (Stripe test API)
  • An AI agent with a scoped Agent-Key
  • A working proxy request that gets risk-assessed and forwarded
Prerequisites: Docker and Docker Compose installed on your machine.

Step 1: Clone and configure

Clone the GaiterGuard repository and set up your environment:
Edit backend/.env with your configuration:
backend/.env
Security: Replace JWT_SECRET and ENCRYPTION_SECRET with long, random strings. Use openssl rand -hex 32 to generate secure values.

Step 2: Start services

Launch all containers with Docker Compose:
Wait for services to be healthy:
The backend automatically runs database migrations on startup. Check logs with docker compose logs backend if you see connection errors.

Step 3: Register a user

Open the dashboard at http://localhost:4173 and create your first account:
1

Sign up

Click Sign Up and enter your email and password. This creates a user in the PostgreSQL database.
2

Log in

Sign in with your credentials. You’ll receive a JWT access token that authenticates all dashboard API requests.
Alternatively, use the API directly:
Save the access_token from the login response — you’ll need it for the next steps.

Step 4: Register a service

Create a service entry for the Stripe test API. This stores the base URL, authentication type, and encrypted credentials:
Credentials are encrypted with AES-256-GCM and stored in the credentials table. The bearer_token value is never returned in API responses.
Save the service id (e.g., 1) — you’ll use it when creating an agent.

Step 5: Create an agent

Provision an agent with a scoped Agent-Key:
Save the apiKey now! This is the only time the full key is shown. If you lose it, you’ll need to create a new agent.

Step 6: Test the proxy

Send a low-risk request through the gateway:

Low-risk response (auto-forwarded)

If the risk score is below RISK_THRESHOLD (0.5), you’ll get a 200 response with the Stripe API data:
Response headers:
  • X-Proxy-Status: forwarded — request was automatically approved and forwarded
  • X-Idempotency-Status: processed — idempotency key was recorded

High-risk response (requires approval)

If the risk score meets or exceeds the threshold, you’ll get a 428 response:

Step 7: Approve and execute

For blocked requests, the agent must poll for approval:
1

Poll status endpoint

Response while pending:
2

Approve in dashboard

Open http://localhost:4173/approvals and click Approve on the pending request. You’ll see:
  • The agent’s intent: “Delete customer account per GDPR request”
  • The full HTTP request (method, URL, headers, body)
  • The risk score and explanation
3

Poll again

Once approved, the status changes:
4

Execute the request

GaiterGuard re-fetches credentials from the vault, forwards the request to Stripe, and returns:
Response headers:
  • X-Proxy-Status: executed-approved — request was executed after human approval

What you learned

Secret isolation

Your agent never saw the Stripe API key. GaiterGuard injected it at request time from the encrypted vault.

Risk-based gating

Low-risk GET requests passed through instantly. High-risk DELETE required human approval.

Approval workflow

Blocked requests queue for review. You approved from the dashboard, and the agent executed after polling.

Intent transparency

Every request includes a natural language intent. The LLM checks if the intent matches the actual payload.

Next steps

Installation guide

Deploy GaiterGuard to production with custom configurations.

Architecture

Learn how risk scoring, credential injection, and approval flows work.

Agent integration

Integrate GaiterGuard into your AI agent codebase with polling loops and error handling.

Agent skill

Install the bundled agent skill to teach your AI how to use the gateway protocol.