security: leviathan projection apply reuses generic card scopes (no dedicated write authority) #53

Open
opened 2026-05-10 14:19:23 +02:00 by pdurlej · 2 comments
Owner

Source

3+3 review on PR #50 (feat: add controlled leviathan projection apply), merged 2026-05-10 via chain drain #52.

"real apply reuses generic cards:create/cards:move scopes and lacks dedicated projection write authority/feature gate in the API path"

Problem

Iskra MCP token (or any token with cards:create/cards:move scope) can trigger projection writes through the apply endpoint. There is no projection-specific scope or feature gate to constrain who/what can run applyProjection.

This violates least-privilege: a token issued for normal AI Inbox card creation can drive batch projection mutations against Leviathan board.

Scope

  • Add dedicated projection:write (or similar) scope on machine identities.
  • Gate applyProjection API route on this scope; reject 403 if missing.
  • Add feature flag (default off in production) so projection apply requires both scope + flag.
  • Update docs/agent-mcp-contract.md with new scope/gate.

Non-goals

  • No retroactive scope change on existing tokens (operator decides per-token).
  • No projection feature kill — narrow it.

Acceptance criteria

  • Token with only cards:create scope cannot call applyProjection (returns auth error).
  • Token with projection:write scope + feature flag enabled can apply.
  • Existing AI Inbox card flows (#31, #44, #46 etc.) unchanged.
  • Tests cover both allow and deny paths.

Refs

  • PR #50 (closed-as-merged into chain, on main via #52)
  • 3+3 review comment id 3200

Owner gates

  • Production scope issuance: hard stop, Piotr only.
  • Default feature flag value in production: Piotr decision.
## Source 3+3 review on PR #50 (`feat: add controlled leviathan projection apply`), merged 2026-05-10 via chain drain #52. > "real apply reuses generic `cards:create`/`cards:move` scopes and lacks dedicated projection write authority/feature gate in the API path" ## Problem Iskra MCP token (or any token with `cards:create`/`cards:move` scope) can trigger projection writes through the apply endpoint. There is no projection-specific scope or feature gate to constrain who/what can run `applyProjection`. This violates least-privilege: a token issued for normal AI Inbox card creation can drive batch projection mutations against Leviathan board. ## Scope - Add dedicated `projection:write` (or similar) scope on machine identities. - Gate `applyProjection` API route on this scope; reject 403 if missing. - Add feature flag (default off in production) so projection apply requires both scope + flag. - Update `docs/agent-mcp-contract.md` with new scope/gate. ## Non-goals - No retroactive scope change on existing tokens (operator decides per-token). - No projection feature kill — narrow it. ## Acceptance criteria - Token with only `cards:create` scope cannot call `applyProjection` (returns auth error). - Token with `projection:write` scope + feature flag enabled can apply. - Existing AI Inbox card flows (#31, #44, #46 etc.) unchanged. - Tests cover both allow and deny paths. ## Refs - PR #50 (closed-as-merged into chain, on main via #52) - 3+3 review comment id 3200 ## Owner gates - Production scope issuance: hard stop, Piotr only. - Default feature flag value in production: Piotr decision.
Collaborator

Deployment evidence (Codex, 2026-06-04):

  • Deployed Kan-ductor sha-98f70e7e0cce on RS2000 using platform release compose and kan-migrate.
  • Runtime images are healthy:
    • git.pdurlej.com/pdurlej/kan:sha-98f70e7e0cce
    • git.pdurlej.com/pdurlej/kan-mcp:sha-98f70e7e0cce
  • kan-migrate completed successfully; operational_snapshot table exists in the production Kan database.
  • Runtime smoke passed: https://kan.pdurlej.com/ returns 200 with redirects followed; https://kan.pdurlej.com/mcp/health returns ok: true and upstream kanApi: "ok".
  • Code evidence at deployed commit: applyLeviathanProjection requires projection:write and real writes are gated by KAN_PROJECTION_APPLY_ENABLED=true.
  • Publish evidence: Forgejo Actions docker publish run for deployed main succeeded.

Recommendation: #53 is truly closed.

Deployment evidence (Codex, 2026-06-04): - Deployed Kan-ductor `sha-98f70e7e0cce` on RS2000 using platform release compose and `kan-migrate`. - Runtime images are healthy: - `git.pdurlej.com/pdurlej/kan:sha-98f70e7e0cce` - `git.pdurlej.com/pdurlej/kan-mcp:sha-98f70e7e0cce` - `kan-migrate` completed successfully; `operational_snapshot` table exists in the production Kan database. - Runtime smoke passed: `https://kan.pdurlej.com/` returns 200 with redirects followed; `https://kan.pdurlej.com/mcp/health` returns `ok: true` and upstream `kanApi: "ok"`. - Code evidence at deployed commit: `applyLeviathanProjection` requires `projection:write` and real writes are gated by `KAN_PROJECTION_APPLY_ENABLED=true`. - Publish evidence: Forgejo Actions docker publish run for deployed main succeeded. Recommendation: #53 is truly closed.
Collaborator

{
"confidence": 5,
"effort_hint": "medium",
"escalation": {
"kind": "none",
"reason": ""
},
"evidence_refs": [
{
"note": "Issue reports Leviathan projection apply reusing generic card scopes without dedicated write authority.",
"type": "forgejo",
"value": "issue-title-body-labels-and-target-snapshot"
},
{
"note": "Body states tokens with normal card create or move scopes can trigger batch projection mutations.",
"type": "forgejo",
"value": "issue-body-problem"
},
{
"note": "Scope adds projection write scope, feature flag gating, 403 rejection, and contract documentation updates.",
"type": "forgejo",
"value": "issue-body-scope"
}
],
"impact": 5,
"judge_actor": {
"name": "iskra",
"runtime": "openclaw"
},
"judged_at": "2026-06-08T01:13:00Z",
"labels_to_apply": [
"judge/p0",
"judge/codex-candidate"
],
"piotr_fit": "high",
"priority": "p0",
"rationale_summary": "This is P0 Codex-ready security work because generic card scopes currently authorize high-blast-radius projection writes and violate least privilege.",
"reach": 5,
"recommended_next_action": "codex_candidate",
"rerun_reason": "no_prior_judgment",
"schema": "openclaw.judge.v0",
"target": {
"kind": "issue",
"number": 53,
"repo": "pdurlej/kan-ductor"
},
"target_snapshot": {
"body_hash": "sha256:0474e0e005e943b8db6706403d65867154b2190f1f30d0cd466d3de964d67eec",
"commit_count": null,
"evidence_hash": "sha256:56957fc6ae93fac60a98e7b69131fc23db955d89b270370c0ee27fb2e79a5aa1",
"head_sha": null,
"labels": [
"3plus3-followup",
"priority:p0",
"security"
],
"labels_hash": "sha256:108b6261a9fa1681b7fbb2dafb7d389589e1dd87303b23bbb3bebb919f917115",
"state": "open",
"title_hash": "sha256:963bfff226ba7d288f11739dd459a3cf106cff56f8a938889bf470fc95c54c7f",
"updated_at": "2026-06-04T01:33:52+02:00"
},
"top_caveat": "Keep the production feature flag default-off and verify generic card tokens receive 403 for projection apply."
}

<!-- openclaw.judge.v0 --> { "confidence": 5, "effort_hint": "medium", "escalation": { "kind": "none", "reason": "" }, "evidence_refs": [ { "note": "Issue reports Leviathan projection apply reusing generic card scopes without dedicated write authority.", "type": "forgejo", "value": "issue-title-body-labels-and-target-snapshot" }, { "note": "Body states tokens with normal card create or move scopes can trigger batch projection mutations.", "type": "forgejo", "value": "issue-body-problem" }, { "note": "Scope adds projection write scope, feature flag gating, 403 rejection, and contract documentation updates.", "type": "forgejo", "value": "issue-body-scope" } ], "impact": 5, "judge_actor": { "name": "iskra", "runtime": "openclaw" }, "judged_at": "2026-06-08T01:13:00Z", "labels_to_apply": [ "judge/p0", "judge/codex-candidate" ], "piotr_fit": "high", "priority": "p0", "rationale_summary": "This is P0 Codex-ready security work because generic card scopes currently authorize high-blast-radius projection writes and violate least privilege.", "reach": 5, "recommended_next_action": "codex_candidate", "rerun_reason": "no_prior_judgment", "schema": "openclaw.judge.v0", "target": { "kind": "issue", "number": 53, "repo": "pdurlej/kan-ductor" }, "target_snapshot": { "body_hash": "sha256:0474e0e005e943b8db6706403d65867154b2190f1f30d0cd466d3de964d67eec", "commit_count": null, "evidence_hash": "sha256:56957fc6ae93fac60a98e7b69131fc23db955d89b270370c0ee27fb2e79a5aa1", "head_sha": null, "labels": [ "3plus3-followup", "priority:p0", "security" ], "labels_hash": "sha256:108b6261a9fa1681b7fbb2dafb7d389589e1dd87303b23bbb3bebb919f917115", "state": "open", "title_hash": "sha256:963bfff226ba7d288f11739dd459a3cf106cff56f8a938889bf470fc95c54c7f", "updated_at": "2026-06-04T01:33:52+02:00" }, "top_caveat": "Keep the production feature flag default-off and verify generic card tokens receive 403 for projection apply." } <!-- /openclaw.judge.v0 -->
Sign in to join this conversation.
No labels
3plus3-followup
agent/claude-code
agent/codex
agent/hermes
agent/iskra
agent/ollama
agent/patchwarden
analytics
api
cockpit
dependency/blocked
dependency/blocks-others
dependency/cross-repo
dependency/needs-confirmation
docs
domain:agents
domain:ci
domain:docs
domain:forgejo
domain:infra
domain:memory
domain:runtime
domain:signal
domain:ux
flow/architecture
flow/blocked
flow/deployed
flow/done
flow/implementation
flow/intake
flow/maintained
flow/observed
flow/ready
flow/refining
flow/retired
flow/review
gemini-flash
judge/codex-candidate
judge/hermes-candidate
judge/low-confidence
judge/needs-refinement
judge/operator-needed
judge/p0
judge/p1
judge/p2
judge/p3
judge/park
judge/patchwarden-candidate
judge/stale-priority
kind/adr
kind/bug
kind/chore
kind/feature
kind/infra
kind/ops
kind/refactor
kind/research
leviathan
mcp
merge/auto
merge/manual
merge/manual-dependency-conflict
merge/manual-failing-tests
merge/manual-merge-conflict
merge/manual-missing-review
merge/manual-operator-preference
merge/manual-red-zone
merge/manual-security-sensitive
merge/manual-unclear-scope
merge/manual-unknown
mode:operator-only
mode:patchwarden-iskra-approved
mode:safe-auto
observed/erroring
observed/needs-followup
observed/pending
observed/retire-candidate
observed/unused
observed/used
ops
priority:p0
priority:p1
priority:p2
priority:p3
review:claude-reviewed
review:codex-reviewed
review:dziadek-reviewed
review:needs-human
safety
safety:external-write
safety:no-prod-mutation
safety:prod-impact
safety:secret-touch
scout
security
size/large
size/medium
size/small
size/tiny
size/unknown
small-task
source/adr
source/agent-generated
source/manual
source/operator-chat
source/voice-note
status:blocked
status:codex-ready
status:merged:pending-evidence
status:needs-evidence
status:operator-needed
status:parked
tests
tier:0-platform-substrate
tier:1-iskra-value-layer
tier:2-tools-products-modules
type:bug
type:chore
type:docs
type:feat
type:policy
type:research
ui
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pdurlej/kan-ductor#53
No description provided.