Files
CASAN/docs/packaging/PROMPT_ENFORCEMENT_GUIDE.md
T

3.0 KiB

CASAN Prompt Enforcement for Adopted Projects

For the canonical agentic-coding guide installed into downstream repositories, see docs/casan/CASAN_PROMPT_ENFORCEMENT.md. For a full Windows installation starting from a repository with no CASAN files, see docs/casan/CASAN_ADOPTION_WINDOWS.md.

The DevKit installer configures an adopted repository so supported repository agents and team members use CASAN as the certified prompt boundary.

What is enforced

  • bin/casan-chat is the macOS/Linux/WSL2 prompt entrypoint.
  • bin/casan-chat.ps1 is the Windows wrapper and executes the same entrypoint through WSL2.
  • .casan/prompt-policy.json binds prompts and H6 telemetry to one project_id.
  • AGENTS.md, CLAUDE.md, and .github/copilot-instructions.md tell supported repository agents to refuse direct prompt work and require resubmission through CASAN.
  • The standalone .gitea/workflows/casan-prompt-enforcement.yml workflow verifies that the policy, launchers, instructions, domain root, and workflow contract are present and have not been stripped. Existing project CI is not overwritten.
  • A certified prompt must produce a trace with passing H1-H7 gates and H6 telemetry attributed to the configured project.

Enforcement boundary

A repository cannot technically intercept text typed directly into an external ChatGPT, Claude, or Copilot website. Such conversations are outside the CASAN runtime and therefore are not CASAN-certified. The enforceable rule is:

  1. Use a CASAN-owned entrypoint for every project prompt.
  2. Repository-aware agents must refuse direct execution when their instruction file is loaded.
  3. Accept governed output only when its CASAN trace passes verification.

For stronger organizational control, restrict direct external AI sites at the identity, proxy, or network layer. That control is outside the repository and complements CASAN rather than replacing its H1-H7 evidence.

Install or upgrade

From a checked-out CASAN Core repository:

packages/casan-devkit/install.sh \
  --target "/absolute/path/to/existing-project" \
  --project "project-id" \
  --domain "Project display name"

The installer is idempotent for the managed instruction blocks. Existing content outside the CASAN markers, project domain documents, project registry, and existing CI workflows is retained.

Send prompts

macOS, Linux, or WSL2:

bin/casan-chat "Review the current requirements and identify missing acceptance criteria"

Windows PowerShell with WSL2:

powershell -ExecutionPolicy Bypass -File bin\casan-chat.ps1 "Review the current requirements"

Run without a prompt to enter interactive mode.

Verify

Verify the repository contract:

bin/casan prompt verify

Verify an individual governed result:

bin/casan prompt trace <trace-id>

Only the second command proves that the individual prompt completed H1-H7 and has matching H6 project telemetry.