Idea
For application authors and their coding agents
Check who may do what
A handler can return valid JSON and still expose someone else’s notes. A test with Alice’s account may miss the mistake. We built a checker that follows how every supported database operation in the program uses its declared access policy.
Break a rule, then check the repair
1. Read the caller’s notes
The broken handler reads another user’s row. Run function shows the leaked note; Check access finds the bad key. Then try After the fix.
Code & run Owner-key defect and repair
2. Keep a private thread behind its guard
Run read_thread as Bob, then as carol, who is not a member. The checker confirms the guard is used; whether the guard says what you meant is your call.
Code & run Membership guards in the forum
3. Keep a moderator helper behind a role-protected route
Moderators can read a named owner’s notes. Ask your agent to swap the role-protected route for an ordinary one, and the check catches that anyone signed in can now reach the privileged read.
Code & run Role authority follows every route to a handler
Three questions behind a permission check
- At the server boundary
Who may enter?
The engine verifies identity and required roles before calling the handler.
route / role_route / public_route - In the compiled handler
What may it do?
Compare declared read, write, create, delete, and query permissions with inferred database effects.
api_permissions - At each database operation
Which rows may it use?
Check owner keys, required guards, or the roles required by every route reaching the operation.
api_access_check
The four resource policies
OwnerScoped- Each user’s rows are read and written with their own id.
Guarded(guards)- Declared predicates, such as thread membership, control row use.
GuardedOrRoles(guards, roles)- The guards, or every route reaching the handler requires the listed roles.
Public- No row discipline; route authority and declared permissions still apply.
What a result does not cover
These checks read the program. They do not authenticate a network request or certify a production database or identity provider; the engine running the program supplies the caller and enforces the routes. Connect your agent and it will walk you through any finding and what it rests on.
Ask your agent about anything here; it has the detail.