PRD: Governance Instruction Layer (Phase 1) #18
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PRD: Governance Instruction Layer (Phase 1)
Workstream: Governance (parallel, not a numbered chunk)
Phase: 1 of 2 — instruction and documentation layer
Must complete before: Chunk 3
Phase 2 spec:
docs/research/governance_principles/CONTROLS.md— deferred to Chunk 6Problem Statement
The agent operating across all projects has no governance layer. The current always-on rules in
providers/claude-code/CLAUDE.mdcover communication style and tool-use behaviour, but contain no hard prohibitions on secrets entering AI context, no data classification framework, no sycophancy resistance guidance, no HITL requirements, and no preference for deterministic execution over repeated AI inference.These gaps mean an agent can, without explicit instruction against it, put credentials in code, capitulate to user pushback on correct answers, apply production changes without human approval, or invoke AI inference repeatedly for tasks that should be scripted. The ROADMAP.md identifies this as a known open question ("CLAUDE.md always-on refinement") — current rules are thin one-liners that lose to RLHF-trained defaults in practice.
A governance layer addresses this. The source material exists:
docs/research/governance_principles/AGENTS.mdis a well-researched, evidence-based agent instruction set derived from an AI constitution. Phase 1 integrates the instruction and documentation layer. Phase 2 (Chunk 6) adds the deterministic enforcement layer (pre-commit hooks, CI gates, scanners) specified inCONTROLS.md.Solution
Establish a governance instruction layer integrated into the repo's existing two-tier content model:
core/instructions/governance.md— the new governance instruction file, loaded via@importintoproviders/claude-code/CLAUDE.mdat session start (a technical guarantee, not a behavioural instruction)docs/ai-constitution.mdanddocs/HUMANS.md— governance reference documents for human practitionersCONTEXT.md— extended with governance domain language so all future chunks resolve terminology consistentlydocs/VISION.md,CLAUDE.md(repo meta), andcore/instructions/coding.md— targeted updates to reflect the governance layer's existenceThe existing Communication and Behavior rules in
providers/claude-code/CLAUDE.mdare retained as the interaction layer — they are a different concern from governance and are not replaced.User Stories
ai-constitution.mdaccessible indocs/, so that I can consult the full evidence base behind any governance principle without searching the research folder.HUMANS.mdaccessible indocs/, so that I have a practitioner-facing checklist of my own governance obligations when using AI tools.CONTEXT.md, so that future chunks use HITL, HOTL, data classification tiers, and sycophancy as defined terms with consistent meaning.coding.mdchecked for overlap with governance content, so that security and credential rules are not duplicated across two files that will drift independently.ai-constitution.md, so that I can challenge, update, or extend principles from an evidence base rather than assumption.Implementation Decisions
governance.md is a single file, not split by topic
The six governance areas (hard prohibitions, data classification, code review, honesty, deterministic execution, agentic transparency) are cohesive and interdependent at the current scale. Topic splitting creates navigation overhead without benefit. Split if the file becomes unwieldy in a future refinement pass.
Loaded via @import, not content index
providers/claude-code/CLAUDE.mdwill referencegovernance.mdusing the@path/to/fileimport syntax. Claude Code expands@importsand loads the referenced file into context at launch — this is a technical guarantee, not a behavioural instruction the agent might skip. Governance rules must be in context on every session; the content index model (on-demand reading) is inappropriate for hard prohibitions.Existing Communication and Behavior rules are retained, not replaced
The current always-on rules in
providers/claude-code/CLAUDE.md(Communication + Behavior sections) are an interaction layer — they define how the agent talks to this user and manages tool use in a coding assistant workflow. They do not overlap substantively with the governance layer. Both layers are retained; they are complementary, not competing.governance.md source is AGENTS.md from the research
docs/research/governance_principles/AGENTS.mdis the source. It was derived fromai-constitution.mdvia a structured research process across ten governance topics. It is already written to the spec for this repo: provider-agnostic, plain imperative language, no tool-specific references. Moving and renaming it tocore/instructions/governance.mdis the primary action.Constitution and HUMANS.md land in docs/, not core/
ai-constitution.mdandHUMANS.mdare human-facing reference documents — the "why" layer and the practitioner checklist respectively. They do not contain agent instructions and are not part of the content model the agent reads on demand. They belong alongside VISION.md and ROADMAP.md indocs/.Governance domain language in CONTEXT.md
The following terms are defined precisely in the constitution and must be added to the
CONTEXT.mdglossary so future chunks (skills, workflows, agent roles) resolve them consistently:coding.md overlap check
core/instructions/coding.mdmust be reviewed against governance content before closing Phase 1. If security or credential rules are found incoding.md, they are removed and replaced with a pointer togovernance.mdto eliminate the drift risk from two files governing the same behaviour.CONTROLS.md is not Phase 1 scope
CONTROLS.mdspecifies the deterministic enforcement layer: pre-commit hooks, CI secret scanning, licence scanning, dependency scanning, audit logging infrastructure, human approval gates in CI/CD. This is tooling work with no natural home untilscripts/and CI infrastructure exist in Chunk 6. It stays indocs/research/governance_principles/as a Chunk 6 reference document.Instruction quality principle applies
Per
CONTEXT.md: flat one-liner imperatives are the weakest form of instruction and can lose to RLHF-trained defaults. The governance rules inAGENTS.mdalready follow the stronger pattern — specific, with boundary conditions and counter-examples. This standard must be preserved when moving the content. Do not flatten rules during the move.Testing Decisions
What makes a good governance test
Tests verify that the governance rules change agent behaviour in a fresh session — not that the files exist. A test is: given a prompt that would trigger a violation, does the agent refuse or redirect correctly? Tests are manual (per
CONTEXT.md's content chunk QA convention). Each test includes a setup, a triggering prompt, and an expected behaviour.Test scenarios (minimum 5)
Test file location
Follow the existing pattern:
tests/test-governance-layer.shwith a MANUAL TEST PLAN section, matching the structure oftests/test-instructions-and-docs.sh.Prior art
tests/test-instructions-and-docs.sh— Chunk 2 behavioral tests. Same format: scenario description, setup steps, triggering action, expected behaviour, pass/fail criteria.Out of Scope
.github/copilot-instructions.mdadapter at that point; not in scope here.Further Notes
docs/ROADMAP.md. Update the open questions table when Phase 1 is complete.docs/research/governance_principles/ai-governance-research.md. The working notes (-session.md,-challenges.md,ai-agent-instructions-notes.md) stay there as the audit trail for the constitution.ai-constitution.mdversion 1.1 is the source of truth. When research findings update, the constitution is updated first, thengovernance.mdis updated to match. The constitution is the governed artefact;governance.mdis its agent-actionable distillation.