Skip to main content
← Back to list
01Issue
BugShippedSwamp CLIPublic
Assigneesstack72

Relationships

#1682 swamp access grant create never registers the grant — a --deny created this way silently fails open

Opened by skunk-ape · 8/17/2026· Shipped 8/17/2026

swamp access grant create reports success and returns a grant object with an id, but the grant is never registered. It is absent from swamp access grant list, swamp access check does not see it, and it is not in the policy snapshot. This holds both locally and against a running swamp serve with an authenticated admin token.

The declarative path (grants/*.yaml plus swamp access reload --server) works correctly, so only the CLI create path is affected.

Why it matters

A --deny grant created this way silently does not take effect, so this fails open. An operator cutting a principal off through the documented CLI gets a success message, and the principal keeps full access.

Reproduce — deny is silently ignored

$ swamp access check --subject user:dev1 --action run --on model:rocky-road \
    --server ws://127.0.0.1:8899 --token "$ADMIN"
ALLOW via grant 603c588f… (user:dev1 → run → model:rocky-road)

$ swamp access grant create --subject user:dev1 --deny run --on model:rocky-road \
    --server ws://127.0.0.1:8899 --token "$ADMIN"
  Completed   create on grant-… succeeded

$ swamp access check --subject user:dev1 --action run --on model:rocky-road \
    --server ws://127.0.0.1:8899 --token "$ADMIN"
ALLOW via grant 603c588f… (user:dev1 → run → model:rocky-road)

Not just the check command — the principal really does still run:

$ swamp model method run rocky-road status --input workItem=rr-publish-ready \
    --server ws://127.0.0.1:8899 --token "dev1-sandbox.<secret>"
  Completed   status on rocky-road succeeded in 28ms

Reproduce — allow is equally invisible

$ swamp access grant create --subject user:bugrepro-local --allow run --on model:rocky-road
  ... "source": "method", "createdBy": "user:local"

$ swamp access grant list --json | jq '[.[].subject.name]'
["seth","dev1","dev1"]        # bugrepro-local absent

$ swamp access check --subject user:bugrepro-local --action run --on model:rocky-road
DENY (implicit) — no matching grants

Same result with --server and an admin token (user:bugrepro-server).

Where the record actually goes

Rather than registering a grant, the command creates a @swamp/grant model instance and writes versioned data for it:

$ ls .swamp/data/@swamp/grant/
905eb9e4-…  997834cd-…  c4c1d3d3-…  ebdcf0ba-…

$ swamp data get grant-ef8fe4e6 grant-main --json
"content": { "subject": {"kind":"user","name":"dev1"}, "effect":"allow",
             "actions":["run"], "resource":{"kind":"model","pattern":"rocky-road"},
             "state":"active", "source":"method" }

The record is well-formed and marked active. Nothing reads it. Note also that swamp model search grant returns no results, so these instances are not discoverable through the model surface either.

Expected

swamp access grant create registers a grant that grant list, access check, and the policy snapshot all see — or it fails loudly. A --deny that reports success and does not apply is the dangerous case.

Secondary observation

createdBy is recorded as user:local even when the call is authenticated through the server as user:seth. The same run reports initiatedBy: user:seth correctly, so the authenticated principal is available but not used for createdBy.

#1676 — same command, and the same "create a @swamp/grant model instance" path (its repro shows Completed create on grant-f2c1ff23 succeeded). That fix stopped the unwanted registry install; the grant still is not registered.

Environment

swamp 20260817.010424.0-sha.21133ea1, macOS 25.6.0 arm64, --auth-mode token, filesystem datastore, single local instance, policy reload mode manual.

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 3 MOREFINDINGS+ 4 MOREPR_MERGED+ 2 MORESESSION_SUMMARIZED

Shipped

8/17/2026, 8:48:22 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack728/17/2026, 2:55:20 PM
Editable. Press Enter to edit.

stack72 commented 8/17/2026, 8:48:31 PM

Thanks @skunk-ape for reporting this! The fix has been merged and a release is on its way. We appreciate your contribution to swamp.

Sign in to post a ripple.