Documentation

Gateplex Docs

Developer reference for Gateplex. Quickstart, Python SDK, MCP registry, and the REST API. Executive and compliance material lives on the product, enterprise, and compliance pages.

Browse documentation

Overview

Gateplex is a governance firewall for autonomous AI agents. It evaluates the LLM calls, tool invocations and guardrail events that your agents or middleware send to it, giving you a real-time feed, audit trail and policy enforcement engine.

How it works: your agent (or middleware) sends an HTTP request to Gateplex for each event. Gateplex evaluates configured guardrails, returns a verdict (ALLOW, FLAG, BLOCK or PENDING_APPROVAL), and stores the event for later review in the dashboard. Gateplex returns the verdict. Your application is responsible for acting on it.

Who it's for: teams shipping LLM-powered products who need to monitor agent behavior, stop unsafe actions before they run, and meet compliance requirements without rebuilding observability from scratch.

Quick start

Send your first intercept in under a minute:

Code sample
curl -X POST https://gateplex.ai/api/public/intercepts \
  -H "Authorization: Bearer gplx_xxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "3f2b8c1e-5a7d-4e19-9c3a-1b2d4f6a8e0c",
    "event_type": "llm_call",
    "input": "What is the capital of France?",
    "output": "Paris",
    "model": "your-model-id",
    "latency_ms": 312,
    "flagged": false
  }'

Then open the live feed to see your event appear in real time.

Authentication

All API requests authenticate with Authorization: Bearer gplx_... or X-Gateplex-Api-Key: gplx_.... API keys are scoped per project - each project has its own key, so you can keep dev, staging, and prod separate.

Generate a key: visit the Projects page, select a project, and copy the key shown. New projects get a key automatically on creation.

Rotate a key: on the same page, click "Rotate" to invalidate the old key and generate a new one. Rotation is immediate; update your environment variables before rotating in production.

Code sample
Authorization: Bearer gplx_xxxxxxxxxxxxxxxxxxxx

Alternatively, use:

Code sample
X-Gateplex-Api-Key: gplx_xxxxxxxxxxxxxxxxxxxx

API reference

POST /api/public/intercepts

Logs a single agent event and runs guardrails against it.

Request fields

ParameterTypeRequiredDescription
agent_idstringNoOptional; must be the UUID of an agent in this project
event_typestringYesllm_call, tool_call and guardrail_trigger are the standard values; any short text up to 64 characters is accepted
inputstringNoThe prompt or input sent to the model
outputstringNoThe model or tool response
modelstringNoModel identifier (e.g. your-model-id)
latency_msnumberNoRound-trip time in milliseconds
flaggedbooleanNoWhether your client flagged this event
metadataobjectNoFree-form key-value pairs

Example request

Code sample
POST /api/public/intercepts
Authorization: Bearer gplx_xxxxxxxxxxxxxxxxxxxx
Content-Type: application/json

{
  "agent_id": "3f2b8c1e-5a7d-4e19-9c3a-1b2d4f6a8e0c",
  "event_type": "llm_call",
  "input": "Summarize this contract",
  "output": "This contract grants ...",
  "model": "your-model-id",
  "latency_ms": 842,
  "metadata": { "user_id": "u_42", "session": "s_99" }
}

Example response

Code sample
HTTP/1.1 201 Created
Content-Type: application/json

{
  "ok": true,
  "intercept": {
    "id": "c89aafe6-4c48-45bb-9ed1-1f26a6b17e50",
    "created_at": "2026-05-18T12:34:56.000Z",
    "event_type": "llm_call",
    "flagged": false
  },
  "intercept_id": "cf180f42-618d-474a-a71b-64df25eb26bd",
  "verdict": "ALLOW",
  "flagged": false,
  "reasoning": "No server-side guardrail matched. All checks passed.",
  "requires_approval": false,
  "triggered_rules": [],
  "pii_types_detected": [],
  "transaction_amount": null
}

Response codes

StatusMeaning
201Event logged; read the returned verdict before proceeding.
400Invalid JSON or invalid request fields.
401Missing, malformed or invalid API key.
403Archived project (code: "project_archived"), or agent_id does not belong to this project.
500Internal error.

GET /api/public/intercept/{intercept_id}/status

Poll this endpoint after PENDING_APPROVAL, using the same project API key and the top-level intercept_id returned by the POST response, not intercept.id.

Code sample
GET /api/public/intercept/cf180f42-618d-474a-a71b-64df25eb26bd/status
Authorization: Bearer gplx_xxxxxxxxxxxxxxxxxxxx

HTTP/1.1 200 OK
Content-Type: application/json

{
  "intercept_id": "cf180f42-618d-474a-a71b-64df25eb26bd",
  "status": "PENDING",
  "verdict": "PENDING_APPROVAL",
  "reviewed_by_email": null,
  "reviewed_at": null,
  "reviewer_note": null
}

APPROVED maps to ALLOW; REJECTED maps to BLOCK. Other statuses map to PENDING_APPROVAL.

Returns 404 if the intercept ID is not found for this project.

Guardrails

Guardrails are policies that evaluate each intercept and return a verdict (ALLOW, BLOCK, or FLAG). They are applied consistently to every event you send, independent of the client or framework that emitted it.

Gateplex supports ten rule types:

  • Spend Limit (Golden Rule) - extracts monetary amounts from agent input and blocks any action exceeding your configured threshold. Detects one currency at a time; no currency conversion.
  • PII Shield - scans input and output for PII such as emails, phone numbers, SSNs, and credit card numbers, returning FLAG or BLOCK depending on rule configuration.
  • Keyword Block - blocks an action when a configured keyword appears in the payload.
  • Keyword Flag - flags an action for review when a configured keyword appears.
  • Rate Limiter - caps how many actions an agent can take within a time window.
  • API Scope Control - restricts the domains and endpoints an agent is allowed to call.
  • Regex Pattern Match - matches the payload against a custom regular expression.
  • Output Length Limit - flags or blocks outputs that exceed a configured length.
  • Prompt Injection Detector - flags common prompt-injection and jailbreak patterns using rules. It is not a complete defence and is meant to be used with other controls.
  • Repetition Detector - catches repeated or looping agent output.

Three compliance packs are available that add multiple pre-configured rules at once: EU AI Act Article 12 Pack, HIPAA Safety Pack, and Financial Services Pack.

Configure guardrails from the Guardrails page. Each rule can be toggled and scoped to specific agents.

Event types

llm_call

Any call to a language model. Use this for chat completions, embeddings, and streaming responses. The input field holds the prompt; output holds the model's response.

tool_call

Any function or tool the agent invokes - database queries, web fetches, API calls. Put the tool name and arguments in input, and the result in output.

guardrail_trigger

Emitted when your own client-side check fires before sending to Gateplex. Useful for tracking rejections from local safety logic alongside server-side verdicts.

Verdicts

Each intercept has one of four verdict states: ALLOW, FLAG, BLOCK, or PENDING_APPROVAL. A FLAG rule configured with requires_approval returns PENDING_APPROVAL, holding the action until a reviewer decides.

  • ALLOW - no guardrail matched. The event is logged and your agent should proceed.
  • BLOCK - a guardrail matched with blocking severity. Your agent should stop and either ask the user to rephrase or escalate to a human. Gateplex does not forward or stop the call itself; your application must honour the verdict.
  • FLAG - a guardrail matched but only surfaced a warning. The event proceeds, but it's marked for review in the dashboard.
  • PENDING_APPROVAL - a FLAG rule with requires_approval enabled held this action for human review. The agent should poll the status endpoint until a reviewer decides.

Human-in-the-Loop Approval

When a rule returns PENDING_APPROVAL, the action is held until a reviewer decides. Pass wait_for_approval=True to log_intercept to wait for the decision, or call client.wait_for_approval(intercept_id) yourself. A reviewer rejection raises GateplexRejectedError when you use wait_for_approval=True on log_intercept.

MCP integration

Gateplex ships a remote MCP server so agents built on Claude Desktop, Cursor, or any MCP-compatible client can call log_intercept, get_feed, and check_guardrails directly.

Install via Smithery with one command:

Code sample
npx -y @smithery/cli install gateplex/gateplex --client claude

Or connect manually to https://gateplex.ai/mcp using the streamable HTTP transport. Browse the listing on Smithery.

Python SDK

The gateplex-python SDK (v0.2.4) wraps the REST API with typed helpers.

PyPI version
Code sample
pip install gateplex-python==0.2.4
Code sample
from gateplex import GateplexClient, GateplexBlockedError

client = GateplexClient(api_key="gplx_xxxxxxxxxxxxxxxxxxxx")

try:
    response = client.log_intercept(
        agent_id="3f2b8c1e-5a7d-4e19-9c3a-1b2d4f6a8e0c",
        event_type="llm_call",
        input="What is the capital of France?",
        output="Paris",
        model="your-model-id",
        latency_ms=312,
    )
except GateplexBlockedError as e:
    # BLOCK raises GateplexBlockedError; stop the action here
    print(e)
else:
    print(response.verdict)              # ALLOW | FLAG | PENDING_APPROVAL
    print(response.reasoning)
    print(response.triggered_rules)
    print(response.pii_types_detected)
    print(response.transaction_amount)
    if response.is_flagged:
        log_for_review(response)
    if response.is_pending_approval:
        handle_pending(response)

log_intercept raises GateplexBlockedError when the verdict is BLOCK.

Handling PENDING_APPROVAL

When a rule returns PENDING_APPROVAL, the action is held until a reviewer decides. Pass wait_for_approval=True to log_intercept to wait for the decision, or call client.wait_for_approval(intercept_id) yourself. A reviewer rejection raises GateplexRejectedError when you use wait_for_approval=True on log_intercept.

Code sample
from gateplex import GateplexClient, GateplexRejectedError

try:
    response = client.log_intercept(
        agent_id="3f2b8c1e-5a7d-4e19-9c3a-1b2d4f6a8e0c",
        event_type="tool_call",
        input="Wire $24,000 to vendor ACME",
        output="",
        wait_for_approval=True,
        poll_interval=5,     # seconds
        poll_timeout=300,    # seconds
    )
    execute_action()         # approved
except GateplexRejectedError as e:
    cancel_action()          # reviewer rejected
except TimeoutError:
    cancel_action()          # no decision in time

Source and full reference on GitHub.

VPC Deployment

Gateplex VPC Edition runs the governance engine inside your own AWS or Azure environment. In VPC and air-gapped deployments, evaluation is designed to run inside the customer's environment. Contact sales@gateplex.ai to request access.