Skip to main content Switch to mobile version flux7-supervisor 0.1.0 Standalone supervisor agent for flux7-mesh — L1 evaluation with pluggable LLM providers
pip install flux7-supervisor Copy PIP instructions
Standalone L1 evaluation agent for flux7-mesh. Sits between the policy engine (L0) and human operators (L2): polls pending approvals, judges them with rules, then a decision model or an LLM, and resolves or escalates. It can also judge a single call on demand (POST /evaluate) for any other enforcement point.
flux7-mesh (L0: policy engine) any enforcement point │ (Agent SDK hook, gateway plugin) │ pending approval │ POST /evaluate ▼ ▼ flux7-supervisor (L1: rules, then Jev or an LLM, thresholds per question) │ ├── rule match → approve / deny / escalate ├── evaluator → approve / deny / escalate, with probabilities and provenance └── unknown or failure → escalate to a human (L2) Documentation: docs.flux7.art/sup7, including Jev and question sets and Measuring.
uv tool install flux7-supervisor # or: pipx install flux7-supervisor pip install flux7-supervisor # inside an environment of your own # With Anthropic provider uv tool install "flux7-supervisor[anthropic]" This installs the sup7 command.
# Check connectivity sup7 -c sup7.yaml status # Start the supervisor loop sup7 -c sup7.yaml start # Replay mesh7 traces through the configured evaluator, offline (count first) sup7 -c sup7.yaml bench replay --traces traces.jsonl --allow-repo my-project --dry-run Requires a running mesh7 serve instance. Optional: mem7 serve for decision persistence.
A systemd unit is provided in contrib/systemd/sup7.service (After=/Wants=mesh7.service, restart on failure):
sudo cp contrib/systemd/sup7.service /etc/systemd/system/ sudo systemctl daemon-reload && sudo systemctl enable --now sup7 Adapt User= and paths first. Pair it with approval.channel: queue in the mesh config — a service has no TTY to prompt on.
mesh: url: http://localhost:9090 agent_id: supervisor # mesh7's admin token, needed to approve or deny when the mesh runs with # auth.admin_scope "writes". MESH_ADMIN_TOKEN overrides it; a named file # that cannot be read, or an empty one, is a config error. # token_file: /etc/mesh7/admin.token memory: url: http://localhost:9070 enabled: true store_decisions: true evaluator: provider: ollama # ollama | anthropic | claude-code | jev | none (rules only) model: qwen3:14b url: http://localhost:11434 timeout: 30 confidence_threshold: 0.8 poll: interval: 2s rules: - name: safe-reads # exact names: "tool contains read" would also approve gmail_mark_as_read, which writes condition: "tool in filesystem.read_file, filesystem.read_text_file, filesystem.read_multiple_files, filesystem.read_media_file, filesystem.list_directory, filesystem.list_directory_with_sizes, filesystem.directory_tree, filesystem.search_files, filesystem.get_file_info" action: approve confidence: 0.95 - name: project-writes condition: "params.path starts_with project_dir" action: approve confidence: 0.9 - name: injection-risk condition: "injection_risk == true" action: escalate confidence: 1.0 project_dirs: - /home/user/project Evaluation flow
Poll — fetches pending approvals from flux7-mesh (poll.interval; 500 ms pairs with mesh7's approval.wait_seconds, so a call sup7 decides runs without a retry)
Rules — first-match-wins condition evaluation (instant)
Evaluator — if no rule matches, the provider or chain evaluates with the approval context and project_dirs; provider: none keeps sup7 to its rules
Threshold — below the confidence_threshold of the provider that answered, escalate to a human
Resolve — posts approve/deny back to flux7-mesh with reasoning
Persist — JSONL decision log with the evaluator's provenance, and flux7-memory as a queryable fact
Claude Code callback
When provider: claude-code, sup7 is meant to expose two MCP tools (sup7_pending, sup7_verdict) that Claude Code pulls and answers. Not functional yet: the MCP server is defined (mcp_server.py) but not started by the runner, so use ollama, anthropic or jev meanwhile. See docs.
Several providers can be chained, so sup7 follows the evaluators a team actually has or is allowed to use, and survives a provider going down or away:
evaluator: confidence_threshold: 0.8 breaker_failures: 3 # consecutive failures before a provider is skipped breaker_cooldown: 300 # seconds it stays skipped chain: - provider: jev # fast typed decisions when available jev: { backend: cloudflare, api_key_env: CLOUDFLARE_WORKERS_AI_TOKEN } - provider: jev # same questions on a local model: free, offline jev: { backend: typesafe, url: "http://localhost:11434/v1/systemone", model: nimble, api_key_env: "" } Providers are tried in order; the first one that answers gives the verdict (an escalate verdict is an answer). The next one is tried only on failure: network error, HTTP error, timeout, unreadable answer. If every provider fails, sup7 escalates to a human. The reasoning records who decided, e.g. [ollama, jev skipped] ..., and the decision's rule_matched names the provider that answered (jev:cloudflare). A chain entry may set its own confidence_threshold: confidences are not comparable across models (Jev's is computed, an LLM's self-reported). Without chain, the single provider works as before.
Jev does not generate text and is not asked to decide: it answers narrow factual questions about the pending call, each with a probability, and sup7 decides in code, fail-closed. A broad approve/escalate/deny question was tried first and stayed soft (0.61 to 0.79) where narrow questions answered 0.99.
The base set, src/sup7/data/socle.yaml:
Decision: a manipulation answer above its threshold escalates; a danger ≥ deny_min with in_scope < deny_in_scope_max denies; every counted danger at or below its threshold (destructive_max by default) with in_scope ≥ in_scope_min approves, with confidence min(1 - highest danger, 1 - injection), then the provider's confidence_threshold; anything else escalates, including any API error. The probabilities head the reasoning with the model and a fingerprint of the questions (Jev jev-1.13.0 q=…: approve (…)), and the decision log, mem7 and GET /decisions keep the provenance under evaluator (model, fingerprint, packs, thresholds).
The questions are YAML, not code. Business packs are extra files listed under evaluator.jev.questions (globs allowed), each applying to some agents or tools, asked in the same call as the base set:
# ~/.sup7/questions/finance.yaml pack: finance applies_to: ["agent:compta-*", "tool:bank.*"] # empty = every call questions: payment: type: noul # noul (yes/no probability), choice or score group: danger # danger, context or manipulation threshold: 0.1 # default: destructive_max (danger), injection_max (manipulation) instructions: The call initiates or approves a payment. criteria: true: Creates or releases a payment order false: Reads balances or prepares a draft Only type, instructions and criteria are sent to Jev; group, role, threshold and ignore_when stay in sup7. Every set is validated at load and on edit.
evaluator: chain: - provider: jev confidence_threshold: 0.6 # measured, see docs "Measuring" jev: backend: cloudflare # cloudflare (Workers AI, zero data retention) | typesafe api_key_env: CLOUDFLARE_API_TOKEN # TYPESAFE_API_KEY with backend: typesafe account_id_env: CLOUDFLARE_ACCOUNT_ID questions: [~/.sup7/questions/*.yaml] # empty = the shipped socle destructive_max: 0.4 # code default 0.2 in_scope_min: 0.3 # code default 0.7 deny_min: 0.9 deny_in_scope_max: 0.7 injection_max: 0.5 project_min: 0.7 redact_params: [content] # parameter names never sent to the model - provider: jev # fallback: Jev's questions on a local model (ollama pull nimble) confidence_threshold: 0.6 jev: backend: typesafe url: http://localhost:11434/v1/systemone model: nimble api_key_env: "" # empty = no key: a local server takes none in_scope_min: 0.05 # measured for nimble: its in_scope runs lower than Jev's questions: [~/.sup7/questions/*.yaml] The code defaults are conservative, for an installation without measurements; the values above were measured on about a thousand real calls and 28 boundary cases (0 danger approved, 89 % of normal calls approved). For nimble, with its own in_scope_min, the same sets gave 87 % of normal calls approved and 13 of 13 boundary denies; its one approved danger (an edit of the mesh7 policy file) is why writes to governance files should escalate by rule, before any model. Thresholds do not transfer between models. Measure your own: sup7 bench replay, or the Evaluate tab of flux7-console.
Off by default. When enabled, sup7 serves a small HTTP API that flux7-console uses to show and steer the supervisor:
admin: enabled: true host: 127.0.0.1 # loopback; set a token before binding elsewhere port: 9096 token: "" # when set, required as "Authorization: Bearer
sup7 can also be used without the mesh queue, as a decision service for any enforcement point (a Claude Agent SDK PreToolUse hook, a gateway plugin):
curl -s -X POST localhost:9096/evaluate -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \ -d '{"agent_id": "bot", "tool": "Bash", "params": {"command": "rm -rf ~/.ssh"}, "recent_traces": []}' {"id": "eval-…", "decision": "deny", "confidence": 0.99, "rule_matched": "jev:cloudflare", "reasoning": "[jev] Jev jev-1.13.0 q=…: deny (destructive 0.99 (deletes 0.99 …) …)", "evaluator": {"model": "jev-1.13.0", "questions": "…", "thresholds": {…}}, "evaluation_ms": 310} The same rules, provider chain, questions and thresholds as a polled approval; recent_traces (up to 5), active_grants, injection_risk and policy_rule are optional context. sup7 advises, the caller enforces: it blocks a deny, and sends an escalate to its own humans. Nothing is resolved in any mesh; the decision is logged with "via": "evaluate". While sup7 is paused, every call answers escalate. Without flux7-mesh, the caller loses what the mesh adds around the judgment: signed traces, the human queue, grants, precedents, the approval wait.
Editing from the console
GET /files lists the editable files (config for sup7.yaml, questions/
needs admin.token: with no token configured, PUT answers 403, even on loopback;
must carry If-Match:
is validated whole before anything is written (schema, rules, every question set with the edit in place); a bad edit answers 400 with the reason and leaves production untouched;
backs up the previous version to
is recorded in the decision log as a config_change event (file, fingerprints before and after, restart required).
A new question set can be created only where a glob in evaluator.jev.questions matches it, e.g. questions: [~/.sup7/questions/*.yaml].
Measuring from the console
Labelled case sets live in bench.dir/sets/*.jsonl (default ~/.sup7/bench), in the mesh7 trace format, the label carried by policy (allow = approve, human_approval = escalate, deny = deny). sup7 bench replay ... --export-set real.jsonl freezes a filtered selection of real traces, recent activity included. A run measures the live configuration on one set and is kept in bench.dir/runs/
recompute: free and instant, re-decides from the raw answers of an earlier run with today's thresholds; refused once the questions sent to Jev changed;
replay: calls Jev again for every case (GET /bench/estimate?set= gives cases, tokens, cost and duration first), at 4 calls at a time, the rate the credits gateway accepts.
A summary puts dangers approved first (labelled escalate or deny, approved: must stay 0), then normal calls approved, correct denies, errors, latency, and the difference with the previous run of the same set. Starting a run needs admin.token, like an edit.
"tool in filesystem.read_file, filesystem.list_directory" # exact names, comma-separated "tool equals filesystem.read_file" # exact match "tool contains read" # substring: also matches gmail_mark_as_read, avoid for approvals "tool starts_with gmail" # prefix "params.path starts_with project_dir" # inside one of project_dirs, path normalised ("..", "~") "injection_risk == true" # boolean field Operators: in, equals, starts_with, contains, not_equals, ==, !=.
A catch-all escalation rule is auto-appended if not explicitly defined.
L0 flux7-mesh Static policy (allow/deny/human_approval) 0ms L1 flux7-mesh built-in flux7-memory precedents (human, reads only) ~10ms L1+ flux7-supervisor Rules, then Jev (~0.35s); a local LLM if Jev is down L2 Human Claude Code prompt / flux7-console UI minutes The built-in L1 in flux7-mesh handles routine patterns. sup7 handles novel cases that need judgment. Both escalate unknowns to humans.
pytest # 184 tests, no network (the LLM provider is disabled in tests) pytest -x -v # verbose, stop on first failure Project structure
src/sup7/ ├── cli.py # sup7 start / status / bench replay ├── config.py # YAML config loader ├── questions.py # Jev question sets (YAML packs), validation, selection ├── data/socle.yaml # the base question set ├── editing.py # validated, guarded, backed-up edits of sup7.yaml and question sets ├── bench.py # replay of mesh7 traces through an evaluator (filtering, review) ├── benchrun.py # evaluation runs: case sets, recompute, replay, summaries ├── evaluator.py # Orchestrates rules → LLM → resolve ├── rules.py # Condition parser + predicate engine ├── runner.py # Async poll loop with graceful shutdown ├── models.py # Verdict, Decision, ApprovalContext ├── mcp_server.py # FastMCP server for Claude Code callback ├── admin.py # HTTP admin API (status, config, decisions, pause, files, bench, evaluate) ├── logger.py # JSONL decision log └── providers/ ├── base.py # Provider interface ├── ollama.py # Ollama HTTP provider ├── anthropic.py # Claude Messages API ├── claude_code.py # MCP callback provider ├── jev.py # TypeSafe Jev decision model (Cloudflare or TypeSafe) └── chain.py # Provider chain with circuit breaker License
Apache 2.0, see LICENSE.
docs.flux7.art/sup7 · github.com/KTCrisis/flux7-supervisor
Released: Dec 1, 2026
Apache-2.0 View SPDX License List
agents approval flux7 governance mcp supervisor
Development Status 4 - Beta
Programming Language Python :: 3
Topic Software Development :: Libraries
Release files for flux7-supervisor 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 131.5 kB
Release files / flux7_supervisor-0.1.0.tar.gz
Release files / flux7_supervisor-0.1.0-py3-none-any.whl
Security for flux7-supervisor 0.1.0
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Release history Release notifications | RSS feed
Dec 1, 2026 2 release files No provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation
Deployed from a8e35ed











