How InsightAIShield is put together
The pieces, the order to set them up in, a policy and an SDK call, the switches that matter, the roles, and the API behind every screen.
One engine, many enforcement points, one record
A Python (FastAPI) API, a React app and PostgreSQL for InsightAIShield’s own records (schema shield). Connectors read your sources; enforcement points hand each statement or prompt to the policy engine; every decision lands in the activity record that baselines, reviews, SIEM export and compliance evidence read.
- 1
Add a source
Host, database and user, with the credential as a secret reference (
Estateenv://,aws-sm://,aws-kms://). Test the connection, then harvest and classify. - 2
Write the policies
Start from the discovery scout’s drafts or the policy author. Simulate, replay on recorded activity, run in monitor mode, then propose.
A second lead activates - 3
Choose enforcement
Point clients at the PostgreSQL or MySQL proxy, route apps and agents through the gateway or SDK, or ingest audit logs in monitor mode.
Enforcement - 4
Connect identity and SIEM
Map LDAP or OIDC groups and attributes to policies; add SIEM destinations; invite leads, analysts and administrators.
Identity & SIEM
Grants and rules, as YAML
Immutable once versioned; exported and imported as YAML; evaluated location, store, field. Anything no policy allows is blocked.
code: pci_cardholder_data name: Cardholder data applies_to: {groups: [cards-ops, fraud-analysts, etl, dba]} sources: [cards_mysql, lake] mode: enforce # or monitor: effects recorded, never applied grants: - {scope: location, target: cards_mysql, permissions: [read]} rules: - {type: MASK, target: "class:card_number", params: {mode: keep_last, keep: 4, char: "*"}} - {type: BLOCK_FIELD, target: "class:card_cvv"} - {type: SQL_COMMAND, target: cards_mysql, params: {deny: [DELETE, DROP, TRUNCATE, UPDATE, ALTER]}} - {type: DISALLOW_JOIN, target: cards_mysql.cards.card, params: {with: [cards_mysql.cards.dispute]}}
For apps and AI agents
The Python client sends SQL to the query gateway, prompts and responses to the AI gateway, and tool calls for a check before they run. It never holds a policy or a key: the server decides every call, and a refusal raises Blocked with the server’s reason.
from insightshield_sdk import Shield, Blocked shield = Shield("https://shield.example.com", token="…") # or api_key="…" (an agent acting as itself) res = shield.query("core_banking", "select account_number, balance from accounts where customer_id = 100042") res.rows, res.columns, res.decision, res.sql # masked / tokenized as the policies say safe = shield.guard_prompt(prompt, model="us.anthropic.claude-sonnet-4-5") # the masked prompt, or Blocked shield.check_tool("query_gateway", source="core_banking", sql="…") # before an MCP tool runs
The settings that matter
Set in the environment of the API.
| Variable | What it sets |
|---|---|
INSIGHT_DATABASE_URL, INSIGHT_DATABASE_SCHEMA | The PostgreSQL connection for InsightAIShield’s own records, and its schema (shield) |
SHIELD_AGENTS_LLM, SHIELD_COPILOT_LLM | Whether the agents and the copilot use a language model; 0 runs their deterministic fallbacks, as in the demo |
SHIELD_AGENTS_MAX_LEVEL | The tenant’s autonomy ceiling; confirming, activating, revoking, sending and deciding stay at L2 whatever it says |
SHIELD_TOKEN_KEY | Where a token key’s reference resolves in the demo (env://SHIELD_TOKEN_KEY); in production a secret store or KMS reference |
SHIELD_DETOKENIZE_LIMIT, SHIELD_DETOKENIZE_PERIOD_MINUTES | The detokenize allowance per person: 1,000 tokens per 60 minutes by default |
SHIELD_SIEM_LIVE | Lets released SIEM batches really leave, in production; otherwise every release is a dry run |
SHIELD_PROXY_AUTOSTART | Whether the wire proxies start with the API |
Who can do what
Through the identity service or your SSO.
| Role | In the demo | What they do |
|---|---|---|
| Analyst (member) | Avery Brooks | Works anomalies and incidents, answers prepared decisions, asks the copilot, requests detokenization |
| Data-security lead (curator) | Jordan Ellis | Writes and proposes policies, confirms classifications, runs reviews and signs off evidence; approves what another lead proposed, never their own |
| Administrator | Sam Rivera | Everything a lead does, and administers the tenant; in the demo, the second pair of eyes on Jordan’s proposals |
Every screen is an API call
Under /api/shield, with OpenAPI at /docs. A selection:
| Area | Endpoints |
|---|---|
| Estate & discovery | GET /sources GET /sensitive-map POST /columns/{guid}/confirm |
| Policies | GET /policies POST /policies/{code}/versions/{v}/replay POST /policies/{code}/versions/{v}/approve GET /policies/export.yaml |
| Enforcement | POST /gateway/query POST /monitor/{code}/ingest POST /enforcement/{code}/start |
| Tokenization | GET /vault GET /formats POST /keys/{code}/rotate POST /detokenize |
| AI gateway | POST /ai/scan POST /ai/tool-check GET /ai/events |
| Detect | GET /activity POST /anomalies/scan GET /baselines/{principal} GET /access/findings |
| Report | GET /compliance/{framework}/export.pdf GET /siem/preview GET /posture |