DEV Community

Emery Chen
Emery Chen

Posted on

A Toggle Is Not a Permission: Verify Model Access Below the Admin UI

An admin checkbox is a claim, not a control. It becomes a control only when you can name the code path that rejects the request. Until then, your access model is a screenshot.

This is an opinion piece. It argues one position: admin consoles that expose model access as a single boolean mislead operators. The fix is not a nicer switch. The fix is a verification habit that reads enforcement, not rendering.

The problem is structural, not cosmetic

Three separate questions hide behind one switch on a model card:

  • Is this model enabled for the workspace at all?
  • Which groups may call it?
  • Which individual users may call it?

Collapse those into one enabled flag and two answers disappear. Operators then reason about the checkbox instead of the policy.

Membership adds a fourth confusion. In the MonkeyAI self-host guide, adding a member and granting a team model to a member or group are described as separate administrative steps (self-host section, pinned). The guide also says that when a model is missing, you should check whether it is enabled and accessible to the member or group. That supports a distinction between existence and entitlement. It does not, by itself, prove how any request is rejected.

That distinction is ordinary. Most systems have it. The failure is that the UI rarely shows the gap.

What the pinned source shows, and what it does not

The admin model editor keeps the axes apart. The pinned editor maps authorization.group_ids to groupIds and authorization.user_ids to memberIds. It uses an empty array for either missing list and reads the model's enabled flag separately (models-page.tsx, pinned).

Read that carefully. It proves the form treats the axes as independent inputs. It does not prove the server checks all three on every request. It does not prove a disabled model is rejected for an existing session. It does not prove group scoping is enforced outside the browser. The supplied evidence describes editor state, not the server's access-control decision.

The same caution applies to reporting. The billing details page defines category filters for model, tool, environment and other, plus separate entry type filters for charge, grant, reset, refund and adjustment (billing-details-page.tsx, pinned). Two axes again. But filters shape a view; the supplied evidence does not specify how amounts are calculated. It also does not make a filter an enforcement rule. Never infer backend behavior from UI fields alone.

What the axes should map to

Axis What the pinned source shows What it does not establish A local check to design after reading the request path
enabled The editor reads it separately; the setup guide tells users to check it when a model is missing. That an existing member session or key is rejected after the flag changes. With an allowed member, set the flag to false, make a normal model call, and observe allow or deny. If allowed, record an enforcement or caching gap.
group_ids The editor stores a group list; the setup guide says a team model can be granted to a group. How group membership is resolved, how quickly changes apply, or whether every call path is checked. Use a member whose only grant is through a group. Make a call, remove the group grant or membership, make another call, and observe whether access changes.
user_ids The editor stores a member list separately from groups. Whether the list grants access, excludes access, or serves another purpose. Do not design an outcome test until server code or product documentation defines the field. A result you cannot interpret is not evidence.
Membership The setup guide separates member creation from model grant. That a member who exists is entitled to any model. Create a member without a grant. Observe whether the model is available to that member, then compare with a granted member.

If the UI shows fewer independent axes than your deployment's policy actually uses, treat the gap as a question to resolve before an incident, not as a defect proven by this source.

A verification procedure

Prerequisites:

  • A self-hosted deployment you control, or source you can read at a pinned commit.
  • Two identities: an admin and a member you can deliberately leave without a grant.
  • Access to server logs or the request authorization code.
  • A disposable environment. Deny tests can break live sessions.

Step 1 - Pin the version. Record the source commit or deployed build in your notes. Compare it with the documentation you are trusting. A screenshot from another release is not evidence.

Step 2 - Read the route, not the page. In source, find the handler that serves model listing and the handler that serves model calls. Record every place the policy is read, then every place a decision is enforced. If you cannot read the request path, stop at black-box observation and do not claim enforcement.

Step 3 - Establish the member's baseline. Choose a member who is not in any group or member list that the model policy allows, as far as source or documentation establishes. Confirm the baseline by checking the model's availability for that member. Then attempt a model call through that member's normal client or a documented API route from your deployment. Observe whether the call is allowed or denied. If it is allowed, either the member was not actually unentitled or the call path bypasses the policy you read; reconcile that before continuing. Do not use the admin identity for this test.

Step 4 - Test the group axis. If the server code or docs define group_ids as an allow-list, put the member in a named group and make a model call. Then remove the member from the group, or remove the group grant, and make another call. Observe whether access changes. A grant that never takes effect and a revoke that never takes effect are both mismatches; record the status, any log reason, and the policy state at each observation. If the semantics of the field are not defined, record that as unknown rather than guessing.

Step 5 - Test the enabled flag with the right identity. Use a member who was allowed before the change. Set enabled to false in the model record. Keep using the same unexpired member session or key, not an admin credential. Make a model call and observe the result. A success is a mismatch: the flag is not limiting that path, or a cache is serving the old state. A denial is evidence for that path only; it does not prove that unrelated group or member entries were changed.

Step 6 - Test user_ids only after its semantics are known. The pinned editor evidence only shows a separate member list. Do not add a user to user_ids and assume that grants access. If server code or product documentation defines it as an allow-list, test the same member with and without the entry and observe the call result. If the semantics are not documented, record the field as unknown and do not convert a guess into a test.

Step 7 - Record the matrix. Use one row per identity and one column per axis state. Treat any unrecorded cell as unknown, not as allowed.

Common failure modes

  • Testing with an admin token. A successful call may reflect admin privileges rather than member access. It cannot establish that an ordinary member is denied.
  • Trusting the model list. The setup guide tells users to check enabled and accessibility when a model is missing, but client visibility is not the same as server enforcement. Test the call path when you can.
  • Reading the editor as the rule. The pinned model page shows form inputs. Only a server decision or a log event can show whether a request was rejected.
  • Assuming user_ids semantics. The supplied evidence shows a separate list. It does not say whether entries grant, exclude, or do something else.
  • Treating billing filters as charge rules. The billing page exposes separate category and entry type filters. The supplied evidence does not state how amounts are calculated.
  • Assuming a stale grant. If a change does not take effect, caching or group sync is a hypothesis to check in code or logs, not a fact established by the UI.

Tradeoffs you accept either way

Deny-by-default is safer and louder. It generates support tickets from people who expected the old default.

Per-user lists are precise and drift fast. Groups scale and need a named owner. Pick one primary axis and treat the other as an exception list.

Hiding a model in the UI is a usability choice. It reduces accidental use. It is not a security boundary, and calling it one invites the wrong audit.

More axes mean more permutations to test. That cost is real. It is still cheaper than discovering the gap during an incident.

When this does not apply

Skip this if you cannot read the request path at all. On a closed hosted service, fall back to black-box testing with two real identities and record exactly what you observed. Do not describe that observation as proof of the server's rule.

Skip it for single-user installs with no multi-tenant boundary. There is nothing to scope.

Skip it if the model is not sensitive and a wrong call is cheap. Spend the effort where a leak would hurt.

What I would change in the console

The editable fields are the wrong primary view. Show the resolved policy per identity instead.

  1. An effective-access panel that answers one question for one user.
  2. A link from each toggle to the enforcement point or log event that backs it.
  3. A visible distinction between member existence and model entitlement.
  4. A deny-test control that performs a call as a chosen non-admin identity.

If you cannot point to the function that says no, you shipped a suggestion. Suggestions are fine in a prototype. They are not an access model.


Disclosure. This draft was written with AI assistance. The team preparing material on MonkeyAI commissioned this article; it discusses an engineering task and does not endorse adoption. The procedure above is a proposed verification approach, not a report of executed tests. No command invocations are included because deployment routes, status codes, and log formats vary; a human must check every technical claim, the cited source lines, and DEV's current policy before publishing.

This article was created with AI assistance.

Top comments (0)