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.
Request Headers
Authentication Headers
Agent-Key
Required for: All agent-facing proxy endpoints (POST /proxy, POST /proxy/execute/:actionId)
- Format: Must start with
agt_prefix followed by alphanumeric string - Validation: Checked in
middleware/auth.ts:74 - Usage: SHA-256 hashed and matched against stored
keyHashin theagentstable - Security: Agent key is hashed using SHA-256 before database lookup to prevent plaintext storage
- Missing header:
401 - Missing Agent-Key header - Invalid format:
401 - Invalid Agent-Key format - Invalid key:
401 - Invalid Agent-Key - Revoked key:
401 - Agent key has been revoked
Authorization
Required for: Dashboard and user-facing endpoints (agents, services, etc.)- Format: Must use Bearer token authentication
- Validation: Checked in
middleware/auth.ts:31 - Token Type: JWT access token issued by
/auth/loginor/auth/refresh - Expiration: Tokens expire after a configured duration (verify via JWT payload)
- Missing header:
401 - Missing authorization header - Invalid format:
401 - Invalid authorization header format - Missing token:
401 - Missing token - Invalid/expired token:
401 - Invalid or expired token
The Authorization header is automatically stripped from requests before storing them in the approval queue to prevent credential leakage. See
services/proxy.service.ts:409.Idempotency Headers
Idempotency-Key
Required for:POST and PATCH requests to /proxy
Optional for: GET, PUT, DELETE, HEAD, OPTIONS requests
- Format: String, 1-255 characters
- Scope: Per-agent (different agents can use the same key)
- Behavior: See Idempotency for full details
- TTL: Idempotency keys expire after 24 hours
- Precedence: Header value takes precedence over
idempotencyKeyfield in request body
routes/proxy.ts:48
Content Type Headers
Content-Type
Required for: All requests with a request body- Supported:
application/jsonfor GaiterGuard API endpoints - Proxy Requests: Any Content-Type supported by the target service (passed through)
- Validation: JSON parsing errors return 400 with
Invalid JSON in request body
Response Headers
Standard Headers
Content-Type
All responses include a Content-Type header:Proxy Metadata Headers
These headers are added by the GaiterGuard gateway to proxied responses.X-Proxy-Status
Indicates how the request was processed:forwarded- Request was forwarded to target service and response returnedexecuted-approved- Request was executed after human approval via/proxy/execute/:actionId
routes/proxy.ts:73 and routes/proxy.ts:218
X-Idempotency-Status
Indicates idempotency key usage (only present if idempotency key was provided):processed- Request used an idempotency key (may be cache hit or new request)
The current implementation marks all idempotency-keyed requests as
processed. Future versions may distinguish between hit (cached) and miss (new request).routes/proxy.ts:81
Header Handling in Proxy Requests
Credential Injection
When forwarding requests to target services, GaiterGuard automatically injects authentication credentials based on the service’sauthType:
| Auth Type | Header Added | Source |
|---|---|---|
bearer | Authorization: Bearer {token} | credentials.token |
api_key | X-API-Key: {api_key} or custom header | credentials.api_key or custom key |
basic | Authorization: Basic {base64(user:pass)} | credentials.username, credentials.password |
oauth2 | Authorization: Bearer {access_token} | credentials.access_token |
services/proxy.service.ts:212
Header Stripping for Security
When storing requests in the approval queue, sensitive headers are stripped:SSRF Prevention
GaiterGuard implements strict header and URL validation to prevent SSRF attacks:- Blocks requests to private IP ranges:
127.x,10.x,172.16-31.x,192.168.x,169.254.x - Blocks IPv6 loopback:
::1,fc00:,fe80: - Blocks localhost hostnames
- Only allows
http://andhttps://protocols - Validates target URL matches service baseUrl
services/proxy.service.ts:92