Prepare SbD-ToE Grounded Codegen Context
prepare_sbd_toe_codegen_contextAssembles citable, deterministic security context from declared risks, concerns, technologies, and files for code generation, review, or test planning—without writing or changing code.
Instructions
ASSEMBLES CONTEXT, DOES NOT ACT: writes, changes and validates no code — it gathers deterministic, citable context for YOU to generate, review or plan tests. Declare the context (risk_level, concerns, exposure, data_sensitivity, technologies, changed_files, or chapters/categories); the task is recorded, not interpreted. Statuses: ready_for_codegen, needs_clarification, needs_decomposition (batches that sum to the whole), needs_input, unsupported_scope. Ready: one FUSED object per requirement (id, name, type, description, verify, evidence), citations, adjacency, instructions, size_estimate.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "prepare_sbd_toe_codegen_context"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Defaults to 'codegen'. Changes llm_codegen_instructions flavor. | |
| task | No | Concrete task to ground (e.g. 'Add payload validation to PATCH /users/:id/email'). Required. | |
| debug | No | When true, includes rejected_candidates and trace notes in the output. | |
| stack | No | Free-text stack hint (e.g. 'Node.js/Express'). Informational only at WP5. | |
| detail | No | Response level. lista: every activated requirement verbatim (id, name, type, description, verify, evidence) + citations + instructions/template; grounding and relations by reference; adjacency summary. standard: lista + adjacency detail. full (default): standard + manual_grounding, relations_ref, trace; no envelope, price in size_estimate. lista fits 8,450 tokens, standard 9,200, measured on the real payload; above, needs_decomposition with measured batches that sum to the whole; a single category that alone does not fit is served ready, declared irreducible. 'ultrathin'/'minimal' retired. | |
| chapters | No | 0.21 §6 — FORMA B (como no select): capítulos declarados (source_bundle, p.ex. "11-deploy-seguro"), verificados contra o catálogo. Só no caminho declarativo. | |
| concerns | No | Concerns DECLARADOS. Conjunto FECHADO de 24 valores, gerado do mesmo vocabulário que sbd://toe/activation-vocabulary publica (com o que cada valor activa e quantos requisitos traz por nível). Valores fora do conjunto são DECLARADOS na resposta (unknown_concerns), nunca descartados em silêncio. | |
| exposure | No | Application exposure level. Informational only at WP5. | |
| categories | No | 0.21 §6 — FORMA B: categorias declaradas (p.ex. "AUT", "SES"). É a receita dos lotes de needs_decomposition: cada lote é a partição exacta das categorias que a tua declaração activou (technologies/changed_files/overlay preservados), medida e dentro do envelope salvo irredutível declarado, e a união dos lotes é o conjunto inteiro (m_recall 1). Só no caminho declarativo. | |
| risk_level | No | Application risk level. Filters runtime v0 requirements when provided. | |
| technologies | No | Tecnologias DECLARADAS do vocabulário fechado (containers, kubernetes, iac, ci-cd, sca-sbom, sast, dast, monitoring, jwt) — activam capítulos por TABELA publicada em sbd://toe/activation-vocabulary. Preferir a `stack` em texto livre. | |
| changed_files | No | Optional file paths. Path-based heuristics may add concerns (visible in activation_trace). | |
| selection_mode | No | Semântica da SELECÇÃO (não confundir com `mode`, que é codegen/review/test-plan). declarative (default, contrato v1.18-beta): o conjunto vem do que DECLARASTE (concerns/exposure/data_sensitivity/technologies/changed_files) — sem declarações devolvo needs_input com o vocabulário; o `task` serve para grounding/citações e auditoria, não para escolher requisitos. discover: motor inferencial histórico (a prosa activa), exploratório. | |
| slice_families | No | Context only: activates the AppSec Core slices of these families (g2_context entities + manual_grounding) and never selects requirements; alone it returns needs_input. Not a way to ask: the server writes it into each needs_decomposition batch recipe so the batch carries the context your request activated for its categories — execute the batch's `with` as given. Published values: sbd://toe/activation-vocabulary → slice_families. | |
| data_sensitivity | No | Data sensitivity level. Informational only at WP5. | |
| include_relations | No | Escape hatch for clients that cannot make a second call. When true at detail='lista'/'standard', keeps g2_context.relations inline (dieted: no per-item source) instead of the relations_ref reference. Default false. Ignored at detail='full' (relations always inline there). | |
| regulatory_frameworks | No | Optional regulatory framework IDs or short codes (e.g. 'EXT-DORA', 'CRA'). Resolved via the overlay loader. If the overlay is absent, returns unsupported_scope. | |
| include_regulatory_overlay | No | When true (and overlay is published), enriches the response with regulatory_overlay context. |