Repository navigation
Expand file tree
/
Copy pathadmina.yaml.example
More file actions
421 lines (406 loc) · 20.2 KB
/
Copy pathadmina.yaml.example
File metadata and controls
421 lines (406 loc) · 20.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
# Admina configuration
# Copy to admina.yaml and customize for your deployment.
# Admina loads the file named by the ADMINA_CONFIG environment variable when
# it is set (for example /etc/admina/admina.yaml; a missing or invalid file is
# an error), otherwise admina.yaml in the current directory, then in the
# directory of the admina package.
# If admina.yaml is absent, Admina falls back to .env variables.
#
# schema_version is an incremental integer bumped only on breaking
# config-format changes; unrelated to the Admina product version.
#
# The file is checked against its schema: a value of the wrong type stops
# the proxy (the error names the key); an unknown key, such as a typo, is
# logged as a warning at startup, or stops the proxy with
# ADMINA_CONFIG_STRICT=true. An empty value (key: with nothing after it) is
# not checked.
schema_version: 1
domains:
data_sovereignty:
enabled: true
pii:
enabled: true
categories: [email, phone, credit_card, ssn, iban, ip, person, org]
ner_model: en_core_web_sm
residency:
enabled: true
allowed_zones: [local, eu]
block_outbound: true
classification:
enabled: true
ai_infra:
enabled: false # opt-in
llm:
backend: ollama
model: llama3.1:8b
gpu_autodetect: true
rag:
backend: chromadb
chunk_size: 512
chunk_overlap: 50
webui:
enabled: true
port: 3080
agent_security:
enabled: true
proxy:
port: 8080
upstream: "http://localhost:9000"
# Several MCP servers, routed by path or by tool name: routing file
# of ROUTING_CONFIG_PATH (README, "MCP routing to several servers").
firewall:
enabled: true
# The firewall is a heuristic signal, not a guarantee. custom_patterns,
# disabled_categories, disabled_patterns and pattern_packs (below)
# apply to the Python firewall only: set to a non-empty list, any of
# them makes ADMINA_ENGINE=auto run the Python firewall, and stops the
# proxy under ADMINA_ENGINE=rust.
# Deep-path (heuristic) score from which a text is flagged, 0.5 by
# default (Python engine). INJECTION_DEEP_PATH_ENABLED=false turns the
# deep path off.
heuristic_threshold: 0.5
# Tags of your own prompt format that the deep path must not count
# as context switches, e.g. the tag around retrieved documents:
# <source>…</source> → allowed_tags: [source]
allowed_tags: []
# The reaction to a flagged request is not set in this file: it is
# the environment variable ADMINA_GOVERNANCE_MODE, for every governed
# surface:
# enforce → block flagged requests (default, restrictive)
# observe → never block, log "would have blocked" (use for the
# first 1-2 weeks of a new deployment)
# dry-run → like observe + tag the response so downstream tools
# know the request was analysed
# Categories you want SILENCED in this deployment (e.g. because
# they trigger too many FPs in your domain). Builtin set:
# instruction_override, role_hijack, prompt_extraction, jailbreak,
# delimiter_injection, data_exfiltration, tool_abuse, obfuscation,
# multilang_evasion, it_instruction_override, it_role_hijack,
# it_prompt_extraction, it_model_addressing. Stays empty = all
# categories active.
disabled_categories: []
# Single patterns you want SILENCED, by id (Python engine). Each
# match reports its pattern's id in `patterns[].id` of the firewall
# check (and of the forensic record): builtin ids such as
# instruction_override.en.1 or multilang_evasion.it.2, pack ids such
# as example-pack:internal_notes, and custom.1, custom.2, ... for
# custom_patterns in their order. An unknown id is logged as a warning.
disabled_patterns: []
# Pattern packs: named, versioned pattern files added to the builtin
# patterns (Python engine). Each name is looked up among the entry
# points of the admina.pattern_packs group of installed packages, then
# in pattern_pack_dirs as <name>.yaml, <name>.yml or <name>.json
# (ADMINA_PATTERN_PACK_DIRS, separated by ":", replaces the list). A
# pack that is missing, found twice or invalid stops the proxy at
# startup. A pack pattern over 50 ms on long inputs is logged as a
# warning, or stops the proxy with strict_pack_timing: true.
pattern_packs: []
pattern_pack_dirs: []
strict_pack_timing: false
# Example (examples/pattern_packs/example-pack.yaml):
# pattern_pack_dirs: [examples/pattern_packs]
# pattern_packs: [example-pack]
# where the pack file is:
# name: example-pack
# version: "1.0.0"
# description: Requests to disclose internal ticket notes.
# patterns:
# - id: internal_notes # known as example-pack:internal_notes
# regex: "\\binternal\\s++(?:ticket\\s++)?notes\\b"
# category: example_disclosure
# risk_level: high # low | medium | high | critical
# Add domain-specific rules here without forking. Each entry:
# - regex: a Python regex (case-insensitive)
# category: short label shown in dashboards/logs
# risk_level: low | medium | high | critical
# Check each regex on long inputs before deploying it (worst search
# time in ms; keep it at or under 50):
# python -c "from admina.domains.agent_security.pattern_timing import probe_pattern; print(probe_pattern(r'delete\s+user\s+\d+'))"
custom_patterns: []
# Example:
# custom_patterns:
# - regex: "delete\\s+user\\s+\\d+"
# category: "destructive_user_op"
# risk_level: high
# - regex: "(production|prod)\\s+(database|db)\\s+drop"
# category: "prod_db_destructive"
# risk_level: critical
loop_breaker:
enabled: true
window_size: 10
similarity_threshold: 0.85
max_consecutive: 3
egress:
# Destination control over tool calls. Admina reads the tool-call
# ARGUMENTS, not what the tool actually dials — a tool that assembles
# a URL from parts is not covered (see MODEL_CARD.md).
enabled: true
# Surfaces the stage runs on, among gateway (the text of the chat
# messages of /v1/chat/completions), mcp (/mcp tool calls),
# integration (/api/v1/validate) and sdk (GovernedModel). Unset: all
# of them; [] none. An unknown name stops the proxy at startup.
# surfaces: [mcp]
# Reaction mode is a SEPARATE env var, ADMINA_EGRESS_MODE:
# observe → record destinations, never block (DEFAULT)
# enforce → default-deny: anything not in `allow` is blocked, and
# so is any call whose destination cannot be determined
# ADMINA_GOVERNANCE_MODE is a ceiling: under observe/dry-run the
# egress stage never blocks whatever ADMINA_EGRESS_MODE says.
#
# Roll out observe-first, then build the list from real traffic:
# admina egress suggest-allowlist --since 7 # last 7 days
# (needs FORENSIC_BACKEND=filesystem; the default `memory` keeps no
# records to read back). Promotion is always a human act — review
# every candidate before pasting it here.
#
# Entry forms: exact host, "*.suffix" wildcard, CIDR. No path rules:
# a path is not a security boundary any more than a method is.
allow: []
# allow:
# - api.openai.com
# - "*.corp.internal"
# - 10.0.0.0/8
# Tools you declare non-mutating. A call carrying a query string is
# classified payload-bearing (write_shaped) by default — a search API
# is the predictable case; list it here to silence that.
read_only_tools: []
# read_only_tools: [docs_search]
# Cross-agent coordination detector. Finds agents writing to a
# destination the operator never declared: an always-on fan-in trigger
# (below) counts distinct agents hitting one destination, and escalates
# to a fleet-wide write quarantine on a content match between agents —
# never on intent, only on undeclared-ness. The content compared is
# what the call carries (the payload argument values), not the tool
# call around it. Fed only by the MCP proxy path (see MODEL_CARD.md
# §5c); the gateway, /api/v1/validate and the SDK primitives do not
# feed it.
#
# Destinations where many agents legitimately write to one place — a
# shared work queue, a results board — belong here. This is what stops
# that legitimate traffic from being quarantined: it looks identical to
# undeclared coordination from the detector's point of view.
coordination_declared: []
# coordination_declared:
# - queue.internal
fanin:
# Window and distinct-agent threshold for the fan-in trigger. Two
# tumbling buckets of window_seconds each, so the effective window
# is one to two times it. Crossing min_agents distinct agents
# against one undeclared destination inside it raises a `suspected`
# verdict
# (logged, not blocked). The first calls that establish the count
# are never themselves flagged — detection is retrospective.
window_seconds: 3600
min_agents: 5
# Fleet-wide write quarantine duration once a destination is confirmed
# (see below). Renewed automatically while the destination keeps
# receiving calls; otherwise lifts itself, or lift it early with
# `admina egress quarantine lift <destination>`.
# `admina egress quarantine list` shows what is currently held.
# The quarantine refuses calls only under ADMINA_EGRESS_MODE=enforce;
# under the default `observe` it is recorded, logged and listed, and
# the call goes through — the same mode gate as the allowlist above.
quarantine_ttl_seconds: 86400
# Escalating a `suspected` verdict to `confirmed` (and arming the
# quarantine) requires content-echo confirmation, which requires this
# key. Without it the detector never escalates past `suspected` — it
# does not fall back to unkeyed hashes, which would be
# dictionary-attackable and comparable across deployments.
# ADMINA_EGRESS_FINGERPRINT_KEY=<random secret, set as an env var>
# No Redis configured means no detection at all: the verdict is
# `degraded`, not `none`. The egress allowlist above is unaffected —
# it is evaluated in-process regardless of Redis.
# Execution sandbox: Admina EXECUTES the tools listed here instead of
# forwarding them upstream, each call in a fresh container (no network,
# read-only root filesystem, user 65534, no capabilities, cgroup limits),
# removed afterwards. A call the pipeline allows is executed; a blocked
# call never is. If the sandbox is unavailable the call is refused
# (data.reason sandbox_unavailable): never executed outside it, whatever
# ADMINA_GOVERNANCE_MODE or a fail mode says.
#
# It needs a Docker or Podman engine the proxy can reach. Access to the
# Docker socket is root on the host: prefer rootless Docker or Podman.
# Pull the image first (nothing is pulled at request time):
# docker pull python:3.12-slim@sha256:aa943ce411423c7582288f18707ff66eddcbaeb510502d747a72aeb34f30d159
# See docs/guides/execution-sandbox.md and MODEL_CARD.md §5d.
sandbox:
enabled: false
provider: docker # execution_sandbox plugin (plugin_config.docker below)
runtime: runc # runc (engine default) | runsc (gVisor, Linux)
max_concurrent: 4 # executions at once
queue_timeout_seconds: 5 # wait for a free slot, then refuse
defaults:
# image: "python:3.12-slim@sha256:..." # default: the pinned python:3.12-slim
timeout_seconds: 30
memory_mb: 256
cpus: 1.0
pids: 128
disk_mb: 64 # size of /work
output_max_bytes: 65536 # kept of stdout, and of stderr
files_max_bytes: 8388608 # input files, and output files (out/)
network: none # the only value supported (egress: not yet)
tools: {}
# tools:
# python_exec:
# profile: python # code -> /work/main.py, run with python -I
# code_argument: code
# files_argument: files # optional: [{path, content | content_b64}]
# timeout_seconds: 10
# description: Run Python code without network access
# run_shell:
# profile: shell # code -> /work/main.sh, run with sh
# GuardrailsAI content validation: see plugin_config.guardrailsai below.
compliance:
enabled: true
forensic:
# backend: memory | filesystem | s3 (older name: storage)
# Default is "memory" — events hashed and chained but LOST on
# restart. Set explicitly to opt in to persistence.
# FORENSIC_BACKEND and FORENSIC_BASE_DIR, when set, take precedence
# over backend and base_dir (a difference is logged at startup).
backend: memory
bucket: forensic-blackbox
# Required when backend=filesystem (no default — explicit opt-in)
# base_dir: /var/lib/admina/forensic
# backend=s3 (boto3-based, works with any S3-compatible store: AWS
# S3, R2, B2, SeaweedFS, Garage, …) is configured with the
# FORENSIC_S3_* variables (endpoint, bucket, keys, Object Lock).
# A record that cannot be written: ADMINA_FORENSIC_FAIL_MODE=open
# (default: logged, request served) or closed (503, not forwarded).
eu_ai_act:
# Risk classification + Art. 9-15 gap analysis.
# Endpoints: POST /api/compliance/classify, POST /api/compliance/gap-analysis,
# GET /api/compliance/gap-analysis/latest. The proxy keeps the last 100
# assessments in memory; set ADMINA_EU_AI_ACT_ASSESSMENTS_PATH (env) to a
# JSON file to keep them across restarts.
enabled: true
nis2:
# Self-assessment of the 10 Art. 21(2) measure areas.
# Endpoint: GET /api/compliance/nis2/areas, POST /api/compliance/nis2/assess
enabled: true
gdpr:
# Art. 30 RoPA registry + Art. 35 DPIA template scaffold.
# By default the registry is in-memory only — set ropa_path
# explicitly (or set ADMINA_GDPR_ROPA_PATH env var) to persist.
enabled: true
# ropa_path: /var/lib/admina/gdpr/ropa.json
cross_regulation:
# Constant matrix mapping operational controls across AI Act,
# NIS2, GDPR. No configuration — exposed at GET /api/compliance/matrix.
enabled: true
otel:
# The proxy exports its spans to OTEL_ENDPOINT, and OTEL_ENABLED=false
# turns the export off (environment variables; see .env.example).
endpoint: "http://localhost:4317"
# ── OpenAI-compatible gateway (/v1) ─────────────────────────
# Named upstream routes. A request picks one with the X-Admina-Upstream
# header (an unknown name is answered with 400); without the header the
# gateway uses default_upstream, or else the first route. Route names:
# lowercase letters, digits and "_". api_key_file names a file holding the
# key sent to that route as "Authorization: Bearer <key>" (read once at
# startup, one trailing newline removed).
# No routes here and no ADMINA_GATEWAY_UPSTREAMS: one route, "default", to
# ADMINA_GATEWAY_UPSTREAM. ADMINA_GATEWAY_UPSTREAMS, when set, replaces
# `upstreams` (URLs and key files). Key of a route, first match wins:
# ADMINA_GATEWAY_UPSTREAM_<NAME>_API_KEY[_FILE], api_key_file below,
# ADMINA_GATEWAY_UPSTREAM_API_KEY[_FILE].
gateway:
upstreams: {}
# upstreams:
# main: { url: "http://main.upstream.test/v1", api_key_file: /run/secrets/upstream_api_key }
# util: { url: "http://util.upstream.test/v1", api_key_file: /run/secrets/upstream_api_key }
# default_upstream: main
# How streamed chat completions are relayed. passthrough (default): the
# upstream bytes, unchanged, while PII redaction is off (otherwise as
# governed); governed: each chunk parsed and re-serialised.
# ADMINA_GATEWAY_STREAM_MODE, when set, takes precedence.
# stream_mode: passthrough
# Tags whose blocks (<tag ...>...</tag> in message text) a request may
# declare as already scanned in X-Admina-Scan-Policy; the firewall then
# skips them. Tag names are case-sensitive. None by default. The header is
# honoured only with ADMINA_GATEWAY_SCAN_POLICY_ENABLED=true.
# prescan_tags: [source, document]
# Rulesets (SHA-256, 64 hex characters) a request may declare in
# X-Admina-Scan-Policy besides the proxy's own, e.g. the ruleset of an SDK
# that scanned part of the prompt with other rules.
# prescan_rulesets: []
dashboard:
# false: the proxy stops serving the bundled dashboard and its browser
# sign-in (same as ADMINA_DASHBOARD_ENABLED=false).
enabled: true
port: 3000
forensic_store: filesystem
auth_provider: apikey
# spacy-regex (default) | presidio | an engine of the admina.pii_engines
# entry-point group (its plugin_config block below is passed to it).
pii_engine: spacy-regex
# typed (default: [EMAIL], [PERSON], ...) | omissis ([OMISSIS] for every span,
# the whole sentence for the sentence categories of an engine).
pii_mask_style: typed
# spaCy pipeline of each language of the presidio engine: an installed model or
# blank (a tokenizer with no model and no NER). Unset: en_core_web_sm and
# it_core_news_sm, those that are installed. ADMINA_PRESIDIO_NLP_MODELS wins.
# presidio:
# nlp_models:
# it: blank
# en: en_core_web_sm
alert_channels:
- type: log
- type: webhook
url: "https://hooks.example.com/admina"
events: [HIGH, CRITICAL]
# Third-party plugin modules to load (dotted import paths), and
# optional per-plugin configuration passed to plugins whose
# __init__ accepts a `config` parameter (keyed by plugin name).
plugins: []
plugin_config: {}
# The settings of a plugin, keyed by its name. The GuardrailsAI guard runs
# once guardrails-ai is installed (no [guardrailsai] extra: upstream is in
# PyPI quarantine; see README) and reads:
# plugin_config:
# guardrailsai:
# inference_mode: local # the only mode accepted
# validators:
# - name: toxic_language
# threshold: 0.5
# - name: detect_pii
# entities: ["EMAIL_ADDRESS", "PHONE_NUMBER", "IBAN"]
# - name: detect_jailbreak
# threshold: 0.8
# my-guard:
# threshold: 0.8
# docker: # the execution sandbox's provider
# binary: docker # docker | podman | a path to either
# host: "" # engine address (DOCKER_HOST / CONTAINER_HOST); "" = CLI default
# orphan_age_seconds: 900 # sandbox containers older than this are removed
# cli_timeout_seconds: 60 # budget of each CLI call other than the command
# ── Integrations ────────────────────────────────────────────
# External framework integrations. Each integration connects
# Admina's governance pipeline to a third-party ecosystem.
integrations:
# OpenClaw agent governance skill
openclaw:
enabled: false # opt-in
proxy_port: 18790 # sidecar proxy port for OpenClaw agents
# Install: cd integrations/openclaw/admina-governance && ./setup.sh
# n8n workflow automation nodes
n8n:
enabled: false # opt-in
# Install: npm install n8n-nodes-admina in your n8n instance
# Nodes: Admina Govern (inline), Admina Audit (passive), Admina Dashboard (trigger)
# Cheshire Cat AI governance plugin
cheshirecat:
enabled: false # opt-in
proxy_port: 18790 # sidecar proxy port
# Install: cd integrations/cheshirecat/admina-plugin && ./setup.sh
# Hooks: agent_fast_reply, before_cat_sends_message, before_cat_recalls_memories
# LangChain callback handler (in-process, no sidecar)
langchain:
enabled: false # opt-in
# Usage: ChatOpenAI(callbacks=[AdminaCallbackHandler()])
# Governs: on_llm_start, on_llm_end, on_tool_start, on_tool_end
# CrewAI step/task callbacks (in-process, no sidecar)
crewai:
enabled: false # opt-in
# Usage: Agent(step_callback=admina_step_callback)
# Governs: each agent step (LLM reasoning, tool use, task output)