Overview

Advanced mental model for AI coding agent + AuthRight — read this after First loop. The product idea is What AuthRight is. The long form is Concepts.

The loop

Intent → Understand → Decide → Request Match → OpenSpec | Agent Plan-mode → Implement → Verify

Run Understand → Decide → Request Match → Handoff in the coding agent (host slash/skills). The @authright/cli binary is the offline engine those skills wrap; bare terminal business verbs do not call an LLM.

Artifacts live in the repository .authright/ tree.

  • AuthRight owns discovery, context, decisions, contracts, request match, and review
  • Coding-agent host owns LLM judgment (Brief, packs, plan talk) via delivered skills/commands
  • OpenSpec owns proposal / specs / design / tasks / apply / archive when you pick that handoff (needs the OpenSpec tool)
  • Agent Plan-mode owns the Plan-mode package under .authright/changes/<dir>/agent-plan/ when you pick that handoff (/auth:to-plan)
  • Coding agents own application code changes

AuthRight does not write application source and does not replace OpenSpec or host Plan mode.

Prefer change for Decide; explore is the peer HITL alternative. Pick one handoff command.

The six ideas

1. Auth Context is what IAM looks like today. Run host scan in chat (/auth-scan / /auth:scan / $authright-scan). Heuristic discovery writes .authright/context.yaml. Some notes stay unconfirmed until you decide — they are not decisions. Java and Node.js / TypeScript have the strongest coverage today; Python and Go are supported and being strengthened. More languages and stacks will follow.

2. Decision locks are the durable project constraints. authright init writes an empty .authright/constitution.yaml stub that is not enforced. The first Decide path (/auth:explore or /auth:change) locks decisions from intent and scan observations. A later change appends, or explicitly supersedes a still-valid lock through conflict clarification. Engineering style for a change defaults silently to Keep current style (keep_style) at --ready — there is no Centralize IAM mode choose. When request.md explicitly asks to relocate/centralize auth, that maps into allowed_improvements while mode stays keep_style. Landing/pack_defaults are projected from request commitments ∩ commitment-aligned IAM locks ∩ observed integration mechanisms (Technology Registry) — not showcase pack defaults (Java ≠ always Spring Security). After upgrading, re-analyze open Auth Changes so stale pack_defaults regenerate.

3. An Auth Change is one unit of IAM decision work. Folder under .authright/changes/ with id AUTH-YYYY-NNNN (immutable). Intent, analysis, decisions, security notes, contract, status.

4. Decisions must be accepted before export. Edit decisions.yaml (and related markdown) deliberately, or confirm an auto-plan in chat. Decision Lock: accepted decisions must not be silently inverted during implementation; authright review looks for conflicts.

5. Request match, then pick one handoff. After the plan is locked, request-match checks that the locked plan still matches what you asked. Export waits until that check passes. Pick OpenSpec (to-openspec, needs the OpenSpec tool) or Agent Plan-mode (to-plan in Plan mode)—two handoff commands, same locked change. Coding agents implement outside AuthRight.

6. Review verifies without mutating app source. Review writes under .authright/reviews/—it checks the lock against implementation; it is not a full security audit.

Also useful anytime: /auth:doctor reads your app source and writes a risk report at .authright/diagnosis/report.md. /auth:doc writes a decisions summary under .authright/docs/. Different jobs—don’t mix them up.

Picture

.authright/
├── context.yaml / constitution.yaml
├── diagnosis/report.md      ← doctor: code risk report (read this)
├── docs/                    ← doc: decisions write-up
├── logs/                    ← local run black box (gitignored)
├── changes/AUTH-YYYY-NNNN-…/     ← decide here
└── reviews/AUTH-YYYY-NNNN/      ← verify here

openspec/changes/<slug>/         ← OpenSpec handoff (when OpenSpec is present)
.authright/changes/…/agent-plan/ ← Agent Plan-mode handoff

Offline terminal twins (advanced)

Skills usually drive these verbs for you from chat. The same public verbs exist on the binary for scripts and agent shells—they are offline (no hosted LLM). Prefer First loop host forms for humans.

authright init                    # bootstrap only (human terminal OK)
# offline twins — not the LLM happy path:
authright scan
authright explore -- "…"          # HITL intake without host LLM
authright change -- "…"           # auto-plan intake without host LLM
authright change <id> --ready
authright request-match <id>
authright to-openspec <id> | authright to-plan <id>
authright review <id>

/auth:explore and /auth:change are two Decide commands—pick one. /auth:to-openspec and /auth:to-plan are two handoff commands—pick one.

Brownfield tip: start with Existing projects—host /auth-scan first, don't boil the ocean. Host spelling: How commands work.

On this page