The Empty Array Is Not a Denial: Auditing Model Grants
An operator removes one member from a model's direct access list, saves, and the admin editor displays memberIds: []. It is tempting to conclude access is gone. But if the same member is also covered by a group grant, an
An operator removes one member from a model's direct access list, saves, and the admin editor displays memberIds: []. It is tempting to conclude access is gone. But if the same member is also covered by a group grant, and the implementation combines grants additively, effective access can remain through that group. The editor showed one grant path; the enforcement layer still has to be checked.
This is a reconciliation problem, not a UI bug. When access can be granted through more than one path, an effective access set may be the union of those paths, but only if the authorization model is additive. If the system has deny rules, precedence, or conditional policies, a plain union is the wrong shape. The safe first move is to inventory paths and then verify the combination rule at the enforcement point.
What the pinned source shows and does not
The MonkeyAI setup guide separates two operations that can look similar in an admin panel: creating a member and granting that member access to a model (self-host guide). The guide describes adding a member in System β Members / Groups and granting a team model to a member or group in Resources β Models. It also says that if a model is missing, the operator should check whether it is enabled and accessible to the member or group. Those are operational setup steps. They do not show how a server evaluates a grant, whether a particular request carries group-derived authorization, or whether enabled participates in authorization.
The model editor maps authorization.group_ids to groupIds and authorization.user_ids to memberIds, uses an empty array when either list is missing, and reads the model's enabled flag separately (models-page.tsx, L319βL325). That is observed UI mapping: it describes editor state. It does not establish how the server decides a request. Do not promote a field seen in a frontend file into a backend guarantee.
Two consequences matter before any experiment:
-
An empty array is ambiguous. Because a missing list and an empty list both map to
[]in the editor state, the editor cannot distinguish a model with no direct members from a payload that had no such key. -
Availability and authorization are separate questions at this source.
enabledmay affect whether a model is selectable or visible, but the source does not support using it as proof of access. Verify any gate at the enforcement layer rather than inferring it.
Prerequisites and scope
You need read access to the admin configuration, a timestamped way to enumerate group membership, and a request path to the actual enforcement point: gateway, API, or proxy rather than the editor. You also need a way to authenticate as the member under test. An admin credential tests admin bypass, not member access.
Use a staging copy or read-only production configuration. Do not modify production grants to learn the rule. The method also assumes that grant paths can be enumerated and that there is a reason to believe they combine additively. If the authorization model has deny rules, precedence, or per-request external claims you cannot enumerate, stop at inventory. If there is only one grant path, the union degenerates; a focused positive and negative request test may still be useful, but not a matrix.
If the enforcement point is not reachable from the environment where you can authenticate as the member, the check is untested. The editor is not a substitute.
Step-by-step reconciliation
1. Inventory every grant path
List the mechanisms, not the records: direct member grants, group grants, any default or all-members grant, and administrative roles that bypass the list entirely. Write the list down. An audit that silently omits one path is worse than no audit, because it produces a confident wrong number.
2. Snapshot membership once, with a timestamp
Build a membership map from group ID to the current set of member IDs, and record when you read it. Group membership changes independently of model configuration. A model record can become stale without anyone editing that model.
3. Compute a path-aware candidate set
For each member ID in the direct list, record a path such as direct:model-id. For each group ID in the group list, expand the current membership snapshot and record group:group-id. Include default, all-members, and admin bypasses if they exist. The output should map each member to the set of reasons for access, not just a list of names.
If the additive rule has not been confirmed at enforcement, label the result a candidate set, not effective access. A diff between intended and computed access must show both unexpected and missing members and the path behind each one. A name-only diff hides why deleting one grant did not remove access.
4. Build positive and negative fixtures
Use at least one positive fixture for each path type that is supposed to work: a direct grant and a group-only grant when both exist. Use at least one negative fixture: a member with no direct, group, default, or admin path, and a group with no model grant. Check that the negative member is not silently covered by another path. Each fixture must be a request principal, such as a member account or token, not just a row in a spreadsheet.
5. Check one request per fixture at enforcement
This is an observation-based test, not a measured result in this article. Inputs: the model endpoint or request path, the fixture member's credential, and one ordinary request that the model would process if authorized. Observe whether the request is allowed or denied at the enforcement point, a stable status or body marker, and the time of the request relative to the membership snapshot.
Interpret expected-allow fixtures as passing only when enforcement returns the authorized outcome you chose, not a denial. A downstream model error is not proof that access was denied. Interpret expected-deny fixtures as passing only when enforcement denies the request. If an expected-deny fixture is allowed, stop: either an inventoried path is missing, an admin or default bypass is active, or the fixture was not actually negative. If an expected-allow fixture is denied, check stale membership, the separate enabled or availability state, the wrong principal, missing group expansion, and other policy layers before concluding the path is absent. If the endpoint mixes authorization and model execution, choose a marker that distinguishes denial from a downstream error; otherwise record the result as ambiguous.
6. Diff against intent, then fix the representation
Compare the computed candidate set to the access list you actually intend. Redundant paths are a finding even when current access is correct: they are the reason a future removal will silently fail. Remove redundant paths first, then repeat the fixture set. The same change record should show the grant change and the verification outcome. If enforcement cannot be rechecked, record the change as proposed, not verified.
Kubernetes RBAC is an analogy, not evidence
Kubernetes documents the same shape for RBAC: grants combine additively. A RoleBinding grants permissions to its subjects in the binding's namespace, even when it refers to a ClusterRole. A ClusterRoleBinding grants the referenced role's permissions cluster-wide. Removing one binding can leave equivalent access through another (Kubernetes RBAC docs).
Use this as an analogy for additive grant mechanisms. It is not evidence about MonkeyAI or any other system's enforcement.
Prevent, detect, recover
| Layer | Control | Verification criterion |
|---|---|---|
| Prevent | One grant path per model where possible; document any second path and its owner | A reviewer can name every path for the model and why each exists |
| Detect | Scheduled path-aware diff plus a negative fixture in the same check | Intended and computed sets match with path provenance, membership snapshot is inside the chosen freshness window, and the negative fixture is denied at enforcement |
| Recover | Remove redundant paths, then repeat the fixture set | The change record links the grant edit to the observed enforcement result; the intended positive path still works and the negative fixture remains denied |
Common failure modes
- Reading the editor as the decision. The saved payload reflects editor state; a stale or partial read is not policy.
-
Treating
enabledas access proof. Visibility, availability, and authorization are separate at this source until enforcement evidence says otherwise. - Auditing names instead of paths. You remove the direct member and stop; a group grant keeps working.
- Snapshotting membership once and reusing it. A week-old membership read cannot validate today's union.
- Using an admin credential for a negative fixture. That tests bypass, not the member.
- Assuming additive union when deny rules or precedence exist. The union is a hypothesis until the combination rule is checked.
Verification checklist
Before you accept the result:
- every grant path from step 1 is listed, including defaults and bypasses;
- the combination rule is confirmed additive or the output is labeled a candidate set;
- membership has a timestamp and a freshness window;
- the diff names path provenance, not only members;
- at least one positive fixture for each intended path type succeeds and at least one negative fixture is denied at enforcement using the member principal;
- any mismatch is interpreted against stale data, availability gates, wrong principal, or unmodeled paths;
- anything not checked at enforcement is marked untested.
If any of those is missing, you have a hypothesis, not a finding.
When not to use this
Skip it when grants cannot be enumerated from outside enforcement; when authorization is decided per request by an external identity provider you cannot enumerate; or when the system has deny rules, precedence, or conditional policies that make a simple union misleading. If there is only one grant path, a narrow positive and negative request test is more honest than a matrix. If the system deliberately grants broadcast access and redundant paths carry no risk, the union audit may still inventory configuration but will not detect unintended retention.
The useful boundary question is not who has access, but which invariant, single grant path or a denial fixture per model, should be checked and which layer should own that check.
AI assistance and commission disclosure. This article was created with AI assistance. It was generated from an editorial brief and has not been independently human-verified, executed, or tested. No code or command was run. The request-level checks are proposed observation-based tests, not measured results. The team preparing material about MonkeyAI commissioned this article; it describes an audit task, not adoption or endorsement of the product. Claims about MonkeyAI are limited to the pinned setup guide and editor mapping cited above. No claim is made about actual MonkeyAI enforcement behavior. The Kubernetes RBAC reference is used as an analogy, not as evidence about another system. A human should verify the source line numbers and the destination platform's current policy before publishing. This article was created with AI assistance.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.