# Stage 111: Tenant Vault & Grants (aq111_seal_tenant_vault_and_mint_grant / DB-UNIT-05)

Seals customer API keys, RapidAPI headers, SFTP keys, and OAuth tokens behind AAD-bound vault:// envelopes and mints <=900s grants for 127.0.0.1 or Cloud Run OIDC.

- Atomic micro-queue: `aq111_seal_tenant_vault_and_mint_grant` (visibility: `public_commons`)
- Backing database unit: `DB-UNIT-05` (`Typed Solution Graph & Pareto Composition Core`)
- Database cell: `graph-db.teleon.dev` (`teleon_core.teleon_weighted_graph_edges`, `teleon_core.verified_solution_dags`, `teleon_core.schema_bridge_adapters`)
- Claim row hydration: `single_self_contained_flat_task_row` (100% context inline, normalized writeback)
- Track 2 Sister queue (`SISTER-05`): `sq05-improve-composition-queue.teleon.dev` (Improve planner heuristics, promote recurring agentic subgraphs into cached deterministic macros, and add bridge tools.)
- Lanes: HKDF + AES-256-GCM, Cross-Tenant AAD Lock, <=900s Scoped Grant

## Execution engines & AI Agent freedom contract

- **Deterministic (0 model calls)**: `dijkstra_pareto_type_planner_v1` (RFC 5869 HKDF-SHA256 + AES-256-GCM sealer & HMAC grant broker (0 calls))
- **Hybrid (<=1 model call)**: `single_shim_bridge_synthesizer_v1`
- **AI Agent & Bot Fleet (1..6 calls)**: `novel_architecture_composer_v1` (Zero-secret tool-binding & host-allowlist configurator)
  - Contract: **Instructions + Resources + Freedom to search for new resources and new ways not bound by instructions**

## Database invariants

- Every executable vertex in a composed graph is a Loop; passive files never become model calls.
- Keep the no-extra-material baseline eligible in every Pareto comparison.

## External & internal bot fleet actions

- Bind tenant_id, workspace_id, surface_id, and allowed_egress_hosts into authenticated AEAD AAD
- Refuse missing KEKs and cross-tenant unseal or grant attempts deterministically
- Deliver scoped execution grants to local 127.0.0.1 and Cloud Run runners without exposing secrets to LLM prompts

## Sister self-tuning areas

- Promote high-traffic multi-node subgraphs into 0-model-call deterministic macro code_blocks
- Rebalance 6D Pareto cost weights (quality, tokens, latency, reliability, determinism, reuse)
- Add new algebraic port-shim templates and composition routines
