Policy Playground
The Policy Playground is an interactive browser tool for testing Igris governance policies against real gateway traffic before deploying them in production. URL: https://playground.igrisecurity.com The playground creates real policies and connections in your Igris account via the management API, fires actual requests through the MCP and LLM gateways, classifies the outcome (allowed / denied / redacted / alerted / error), then lets you clean up everything it created.Before you start
You need:- A running Igris API and an API key (
ig_...). Create the key under Settings → API Keys. - An LLM provider key, base URL, and model name. The playground requires them.
- The bundled MCP mock server, reachable from both your browser and your Igris API (see below).
Setup
On first launch, the playground opens a setup dialog. You cannot dismiss it until setup is complete.
Click Test Connection. The dialog runs four checks, and all four must pass before Start Testing appears:
Settings are stored in your browser’s
localStorage, including both keys. To edit them later, click Settings in the header. That dialog can be closed with the X button, a click outside it, or Escape.
The MCP mock server
The playground ships its own mock MCP server with 28 tools across seven categories (file, database, code execution, network, destructive, system, and search), so MCP scenarios need no external server. It listens on port 3600 locally. Its URL is set at build time withNEXT_PUBLIC_MCP_URL (default http://localhost:3600). Both your browser and your Igris API must be able to reach it. The browser calls /health, and your API forwards tool calls to <MCP URL>/mcp. That means it cannot be localhost if your API runs elsewhere. The hosted playground uses https://mcp-playground.igrisecurity.com.
CORS
The playground calls your Igris API directly from the browser. The API’sCORS_ORIGIN setting must include the playground’s origin, for example https://playground.igrisecurity.com or http://localhost:3500. Otherwise the checks fail with the API shown as unreachable. If you run your own API, add the origin to CORS_ORIGIN and restart it.
What setup creates
Scenario Categories
The playground has eleven categories in four groups. Select one in the left sidebar to see its scenarios.
The sidebar shows the number of scenarios in each category.
Running a Scenario
Click Run on a scenario card. The runner:- Creates (or reuses) the required connection with
POST /api/v1/connections - Creates the scenario’s policy with
POST /api/v1/policies, or reuses a policy that already has the same name - Enables that policy and disables every other policy whose name starts with
playground-, so only this scenario’s policy is enforced - Fires the request or requests through the gateway
- Classifies each response and shows the result
enabled flag of your playground- policies.
Multi-request scenarios (rate limits, anomaly detection) show per-request status and a progress indicator. A result card links to View on dashboard. The link opens the Incidents page for denied and alert outcomes, but denials and alerts do not create incidents today, so look for them in the Audit Trail instead. The link assumes the dashboard runs on port 3200 next to an API on port 3100, so it is only reliable for local setups.
Paired Pass-Through
Detector-based cards (PII, Secrets, Injection, and Guard Actions) fire two requests under the same policy:- A prompt containing the trigger content (an SSN, a secret, an injection phrase). The content guard acts on it according to the scenario.
- A clean prompt with no trigger content. The same policy lets it through to the LLM.
choices[0].message.content). This shows that one policy blocks unsafe traffic while letting safe traffic pass.
Outcome Classification
The playground maps each gateway HTTP response to one of five outcomes:The
alert action forwards the request to upstream and logs the event, so the gateway response looks the same as allow. When a scenario expects alert and the request passes through cleanly, the playground reports alert. Confirm it in the Audit Trail, where the event shows the policy that matched, or through your policy_deny webhook. Alerts do not create incidents today. The playground cannot detect the alert from the response alone.Cleanup
The playground tracks every connection slug and policy ID it creates inlocalStorage.
Click Clean Up Resources at the bottom of the sidebar and confirm. It then:
- Deletes tracked policies with
DELETE /api/v1/policies/:id - Deletes tracked connections (
playground-llmandplayground-mcp) withDELETE /api/v1/connections/:slug - Treats resources that are already gone (404) as deleted
- Keeps resources that fail to delete (auth error, network error) in tracking so a later cleanup can retry them
How It Works
The playground is a static Next.js site that talks directly to your Igris API from the browser. There is no playground backend. Every request uses the API key you entered in setup. MCP scenarios send tool calls toPOST /v1/mcp/:slug. LLM scenarios send chat completions to POST /llm/:slug/v1/chat/completions. The model field uses @slug/model syntax, and the playground substitutes the model name you configured at runtime.
Running it locally
http://localhost:3500 and enter your API URL and keys. The API’s CORS_ORIGIN must include http://localhost:3500.