Appendix A: Code Examples: Role, Control and Mandate Artefacts

This appendix collects fuller versions of the artefacts that the chapters introduce: the role charter of the security architect, an excerpt from a control catalogue, a containment profile, a mandate manifest for the architect's own agents, the competence framework and a review record for an AI proposal. Every example is identified as NN_CODE_XXX, where NN is the chapter that introduces the artefact. The artefacts are design and governance records kept under version control; in keeping with the book's rules, none of them is attack tooling.

All identifiers refer to the fictional organisations Nordvik Region and Hansa Mutual and are illustrative, and they agree with the profiles in EXAMPLE_ORGANISATIONS.md. Every YAML listing parses as written. The listings below are short skeletons; each is replaced by its full version when the chapter that introduces it is drafted. Appendix B lists every template and tool with the chapter in which it appears.

Index of examples

Identifier Chapter Artefact Format
04_CODE_ROLE 4 Role charter of the security architect YAML
09_CODE_CTRL 9 Control catalogue excerpt YAML
07_CODE_CONTAIN 7 Containment profile YAML
13_CODE_MANDATE 13 Mandate manifest for an architecture agent team YAML
21_CODE_COMPETENCE 21 Competence framework YAML
14_CODE_REVIEW 14 Review record for an AI proposal YAML

04_CODE_ROLE: Role charter

Illustrative artefact; the full version is added when the chapter that introduces it is drafted.

# roles/security-architect.yaml (Nordvik Region, excerpt)
id: ROLE-NR-SA-01
title: Security architect
organisation: Nordvik Region
reports_to: Chief information security officer
commissioned_by: AIDR-0500
mandate: >
  Design and verify the security boundaries, identity model, controls,
  evidence chain and stop paths of the Region's systems, including those
  that suppliers build and operate.
accountabilities:
  - Security design of systems in scope, recorded as decision records
  - Control catalogue and its mapping to obligations
  - Verification of AI-drafted architecture work before approval
version: 1.0.0
effective: 2027-01-01
decision_rights:
  decide: [gate_policy_for_catalogue_boundary, stop_path_and_egress_requirements_in_tender_annex, compensating_design_for_exception_up_to_90_days]
  veto: [tender_annex_without_stop_path, ai_go_live_without_tested_stop_path]   # override by the CISO, on the record
  recommend:
    - {class: residual_risk_acceptance, decided_by: system_owner}
    - {class: changes_to_MND-NR-01, decided_by: chief_information_security_officer}
  escalate_to_ciso: [exception_beyond_90_days_or_appetite]
own_ai: {mandate: MND-NR-01, max_level: Level 1 Assisted}
does_not:
  - Accept residual risk on behalf of a system owner
  - Operate production systems
review: annual

09_CODE_CTRL: Control catalogue excerpt

Illustrative artefact; the full version is added when the chapter that introduces it is drafted.

# controls/catalogue.yaml (Hansa Mutual, excerpt)
- id: CTRL-AGT-002
  title: Tool calls outside the permission manifest are denied outside the agent
  owner: Head of group AI platform
  architect: AI domain security architect
  obligations:
    - ISO/IEC 27001:2022 Annex A 5.15
    - DORA Article 9
    - AI Act Article 15
  enforcement: policy-as-code
  evidence:
    source: platform-telemetry
    collected_by: evidence-collection agent
    freshness_days: 7
  test: tests/controls/ctrl_agt_002.rego
  status: generated

07_CODE_CONTAIN: Containment profile

Illustrative artefact; the full version is added when the chapter that introduces it is drafted.

# containment/architecture-review-agents.yaml (Hansa Mutual, excerpt)
profile: architecture-review-agents
applies_to: MND-HM-01
identity:
  type: workload
  credentials: task-scoped
  lifetime_minutes: 5   # 15 at first; cut after the stop drill of Chapter 10
egress:
  default: deny
  allow:
    - git.internal.hansa.example
    - models.hansa-dc-frankfurt.internal
data:
  classification_max: confidential
  write: [pull_request_comments]
budget:
  max_tool_calls_per_task: 200
stop_path:
  owner: Head of security architecture
  mechanism: revoke workload identity at the identity provider

13_CODE_MANDATE: Mandate manifest

Illustrative artefact; the full version is added when the chapter that introduces it is drafted.

# mandates/architecture-agent-team.yaml (Hansa Mutual, excerpt)
id: MND-HM-01
owner: Head of security architecture
principle: Agents draft; named architects approve
agents:
  - role: reviewer
    usage_mode: Mode 3 Agentic work tools
    autonomy_level: Level 1 Assisted
    may: [comment_on_pull_request]
  - role: threat-modeller
    usage_mode: Mode 3 Agentic work tools
    autonomy_level: Level 1 Assisted
    may: [propose_threat_model_change]
  - role: evidence-collector
    usage_mode: Mode 5 Autonomous production agents
    autonomy_level: Level 3 Bounded
    may: [refresh_evidence_links]
never:
  - merge_to_main
  - change_own_mandate
containment_profile: architecture-review-agents
review: quarterly

21_CODE_COMPETENCE: Competence framework

Illustrative artefact; the full version is added when the chapter that introduces it is drafted.

# competence/security-architect-framework.yaml (excerpt)
framework: security-architect
mapped_to:
  ecsf: Cybersecurity Architect
domains:
  - id: design
    levels:
      2: Designs a boundary for one system and records the decision
      3: Designs boundaries across a domain and verifies them in the pipeline
    evidence: [decision_records, merged_policy_changes]
  - id: ai
    levels:
      2: Uses Modes 1 to 3 with verification and records prompts
      3: Writes and governs a mandate manifest for an agent team
    evidence: [review_records, mandate_manifests]
  - id: law
    levels:
      2: Maps one article to a control with evidence
      3: Maintains the article-to-control mapping for a regime
    evidence: [catalogue_mappings]

14_CODE_REVIEW: Review record

Illustrative artefact; the full version is added when the chapter that introduces it is drafted.

# reviews/2026/REV-HM-0001.yaml (Hansa Mutual, excerpt)
id: REV-HM-0001
date: 2026-11-02
proposal: pull request changing egress policy for the claims product line
proposed_by: policy-author agent under MND-HM-01
reviewer: Domain security architect, platform and cloud
techniques:
  - independent_re_derivation
  - tests_as_oracle
  - adversarial_second_agent
review_minutes: 35
findings:
  - Proposed allow rule broader than the documented supplier endpoint
decision: changes_requested
decision_record: null  # the review changed no recorded decision