> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inviolet.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# The six enforcement layers

> Where Inviolet sits in your stack — and why each layer matters.

Intent flows through six layers between an LLM tool call and the sensitive data
it ultimately reaches. One missing layer is a bypass waiting to happen.

## L1 — LLM Surface

Tool registry + system-prompt enforcement. The LLM only knows about tools the
gateway exposes; system prompts that try to circumvent intention declarations
fail at the gateway.

## L2 — Fastify Gateway

Intercepts every LLM tool call before it leaves your network. The gateway is
the choke point — every other layer assumes the gateway has already extracted
intent.

## L3 — Intent Intelligence

A FastAPI extractor that parses the tool call into a structured intention
record. Per-user history is keyed by `user_id` so anomalies surface
("alice never reads SSN; this call wants SSN — flag").

## L4 — Policy Layer

Declarative rules that match intentions to allowed elements. **Policy always
wins over history inference.** An intention explicitly allowed in policy is
allowed even if it's anomalous; an intention explicitly denied is denied even
if it's been used before.

## L5 — Token + Credential Layer

Intent tokens minted from approved intentions. Optional Okta token hooks
enrich IdP-issued tokens with the `grant` claim. Vault issues just-in-time
database credentials scoped to the active grant.

## L6 — DB Proxy

Column-level enforcement at the database. Queries are rewritten or blocked
based on the active `grant.elements` list. Blocked columns are highlighted
in the audit log with remediation suggestions.

## Visual

export const LAYERS = [{
  n: 1,
  name: 'LLM Surface',
  detail: 'Tool registry + system-prompt enforcement'
}, {
  n: 2,
  name: 'Fastify Gateway',
  detail: 'The choke point — intercepts every tool call'
}, {
  n: 3,
  name: 'Intent Intelligence',
  detail: 'FastAPI extractor; per-user anomaly history'
}, {
  n: 4,
  name: 'Policy Layer',
  detail: 'Decide allow / deny — policy beats history'
}, {
  n: 5,
  name: 'Token + Credential Layer',
  detail: 'Scoped grants; Vault + Okta hook'
}, {
  n: 6,
  name: 'DB Proxy',
  detail: 'Last-mile, column-level enforcement'
}];

export const Connector = () => <div style={{
  display: 'flex',
  justifyContent: 'center'
}}>
    <div style={{
  width: '2px',
  height: '16px',
  background: 'linear-gradient(rgba(160,32,240,0.7), rgba(160,32,240,0.2))'
}} />
  </div>;

export const EndNode = ({label, sub, dashed}) => <div style={{
  textAlign: 'center',
  padding: '12px 20px',
  borderRadius: '999px',
  background: dashed ? 'transparent' : 'linear-gradient(135deg, #A020F0, #C77DFF)',
  border: dashed ? '1.5px dashed rgba(199,125,255,0.6)' : 'none',
  color: dashed ? '#C9A6F5' : '#fff',
  fontWeight: 600,
  alignSelf: 'center',
  boxShadow: dashed ? 'none' : '0 0 26px rgba(160,32,240,0.45)'
}}>
    {label}
    {sub && <div style={{
  fontSize: '12px',
  fontWeight: 400,
  opacity: 0.85,
  marginTop: '2px'
}}>{sub}</div>}
  </div>;

<div style={{ display: 'flex', flexDirection: 'column', gap: '0', maxWidth: '620px', margin: '2rem auto' }}>
  <EndNode label="LLM tool call" />

  {LAYERS.map((l) => (
      <div key={l.n} style={{ display: 'flex', flexDirection: 'column' }}>
        <Connector />
        <div style={{
          display: 'flex', alignItems: 'center', gap: '16px', padding: '14px 18px',
          borderRadius: '14px', background: 'linear-gradient(135deg, #1E0B3B, #0C0620)',
          border: '1px solid rgba(160,32,240,0.35)', boxShadow: '0 1px 24px rgba(160,32,240,0.10)',
        }}>
          <div style={{
            flex: 'none', width: '46px', height: '46px', borderRadius: '12px',
            display: 'flex', alignItems: 'center', justifyContent: 'center',
            fontWeight: 700, fontSize: '15px', color: '#fff',
            background: 'linear-gradient(135deg, #A020F0, #C77DFF)',
            boxShadow: '0 0 22px rgba(160,32,240,0.45)',
          }}>L{l.n}</div>
          <div style={{ minWidth: 0 }}>
            <div style={{ fontWeight: 600, color: '#F4ECFF' }}>{l.name}</div>
            <div style={{ fontSize: '13px', color: 'rgba(201,166,245,0.85)', marginTop: '2px' }}>{l.detail}</div>
          </div>
        </div>
      </div>
    ))}

  <Connector />

  <EndNode label="Sensitive data" sub="a database row, a SaaS API response, a file" dashed />
</div>

## Adoption order

You don't install all six on day one. The
[maturity model](/concepts/maturity-model) walks you up the stack — start at
L1+L2 (observe), add L3+L4 when patterns are clear, layer L5+L6 when
compliance demands enforcement.

## Read next

* **[The maturity model](/concepts/maturity-model)** — phases of adoption
* **[Install the gateway](/guides/install-the-gateway)** — get L1+L2 running today
