Dev.to Security 🔐 Cybersecurity 👁 0 📖 6 min read

A Revocation Check for Model Visibility in a Self-Hosted AI Workbench

Illustrative scenario, not an observed incident. An offboarding runbook removes Carol from g-eng, because that is where model grants appear to live in the admin UI. It stops there. An hour later a teammate notices Carol'

Illustrative scenario, not an observed incident. An offboarding runbook removes Carol from g-eng, because that is where model grants appear to live in the admin UI. It stops there. An hour later a teammate notices Carol's client still lists the team model in the picker — her access was also recorded as a direct member grant, and the runbook never touched that plane.

This is an AI-assisted draft. The team preparing material about MonkeyAI commissioned it. The checks below are proposed, not executed tests.

That failure is boring, common, and cheap to catch. What it needs is not a better runbook sentence but an expected-visibility matrix written before revocation and checked after, using only evidence you can actually observe in the product.

Who this applies to, and what it assumes

You need a self-hosted AI workbench where model reach is granted per member or per group, at least one admin account, and a client that shows a model picker. You also need the discipline to write down the build or commit you audited, because access screens move.

The approach does not require reading the backend. It requires admitting that you cannot, from the UI alone, and designing a test that survives that gap.

What the official setup guide separates

In the pinned self-hosting guide, adding a member happens in System → Members / Groups, and granting a team model happens separately in Resources → Models, per member or per group. The guide then says a member signs in to the client and selects a model in a conversation — and that when a model is missing, you should check whether it is enabled and accessible to that member or group.

Source: MonkeyAI self-hosting section, pinned commit

Read that last sentence as a spec, not a hint. Two conditions, joined by and: the model is switched on, and the caller is entitled to it. A revocation procedure that only satisfies one condition produces exactly the scenario at the top of this post.

What the model editor actually stores

At the same pinned commit, the model 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.

Source: models-page.tsx, lines 319–325, pinned commit

So the admin screen composes a model record from at least three authorization-relevant inputs. Keep the caveat attached to that observation: a form field boundary tells you how the client writes the record. It does not tell you how the server evaluates a request. A tri-state screen can coexist with a completely different enforcement rule behind it.

The hypothesis, stated as a hypothesis

The proposed local test is whether visibility may be enabled AND (direct member OR group membership). That is not established by the sources above; it is the thing under test. If it holds, revocation is a three-input problem. If it fails somewhere, that failure is the finding worth writing down.

Step 1 — Inventory the three inputs before you change anything

Open the model editor and the member record. Capture, for one model: the enabled state, the full user_ids list, the full group_ids list. Capture for each candidate member their group membership. Record the commit or build identifier alongside it.

Do not summarize. A matrix built from memory is a wish.

Step 2 — Write the expected picker state by hand

Use a matrix with a row per member and an explicit expectation, including the boring rows where nothing should change:

Member Group membership after group-only step Direct grant after group-only step Model enabled Expected after complete revocation Expected after group-only step under hypothesis
alice g-eng yes true visible visible
bob g-eng no true visible visible
carol none yes true hidden visible — direct grant remains
dave g-eng no false hidden hidden

The carol row is the point. A group-only runbook reports success because she is out of g-eng, but the direct grant still predicts visibility under the hypothesis. The dave row catches the opposite error: if enabled is false, removing grants is not the only reason he is hidden.

Include both visible and hidden rows. The hidden rows catch over-permission; the visible rows catch over-revocation.

Step 3 — Run the observation, then interpret mismatches

Write the matrix before touching the runbook. Then perform only the group removal. Sign in as Carol and open the model picker. Record whether team-model-a appears, with timestamp and build identifier. Under the hypothesis, it still appears because the direct grant remains. That is the expected mismatch for a group-only runbook.

Next remove Carol from the direct grant and re-check. Under the hypothesis, the picker should omit the model. If it does not, either the hypothesis is incomplete, the client caches the picker, or another surface or grant plane is involved. Record the exact inputs and do not infer server behavior from the admin table.

Step 4 — Check other surfaces separately

If your deployment also exposes an HTTP or MCP-style surface, that is a different surface with its own negative case. Do not assume a picker result transfers to it, in either direction.

Step 5 — Escalate the disagreement, not the UI

If a member sees a model that all three inputs say they should not, resist the urge to flip enabled off. That fixes visibility for everyone and destroys the evidence, while also silently disabling the model for the members who legitimately need it.

Instead, re-run the observation, capture the exact state of all three inputs, and file the gap as a runtime assertion question. The matrix is what makes it reproducible.

Failure modes worth naming

Failure Symptom Fix at the right layer
Group-only revocation Removed member still sees the model Revoke on every plane the record composes from
Disabling the model as a revoke Everyone loses the model; access and feature state are conflated Revoke the grant, leave enabled alone
Reading the admin table as authority Clean report, reachable model Verify at the client surface; the table is intent
Assuming one surface covers all Web picker clean, other path open Enumerate surfaces, give each a negative case
Treating a quota rejection as spend control Admission rejects a create or update with HTTP 403 A namespace quota constrains aggregate resource use; it is not an invoice or a token price (Kubernetes ResourceQuota)

That last row matters for teams running the workbench on Kubernetes. Admission rejecting a create or update with 403 is a resource-count boundary, not a model-spend boundary. Using it as a cost proxy produces a control that fires late and explains nothing.

Prevent, detect, recover

Layer Control
Prevent Offboarding checklist names all three inputs explicitly, not remove from group
Detect Visibility matrix re-run after any grant edit; negative rows weighted
Recover Recorded pre-revocation state lets you restore the intended grant set exactly

How to check the outcome

Success looks like this: after complete revocation, Carol and Dave are absent from the picker, Alice and Bob still see the model, and enabled is unchanged from the start of the run. If enabled moved, you tested feature state, not grant state.

When this does not apply

Single-tenant deployments with a handful of users and no group grants do not need a matrix; a checklist row is enough. If your platform already exports an authoritative per-member access report, use that and spend the fixture budget on verifying the export instead.

And if your actual concern is cost rather than reach, this entire fixture is the wrong tool. A Kubernetes ResourceQuota constrains aggregate resource use or counts in one namespace; admission rejects a create or update that breaks the quota with HTTP 403. It is not an invoice or an AI token price.

Status of the examples

No code or command was executed while drafting. The two MonkeyAI source observations — the separated member/grant steps and the separately-read enabled field — are cited at a pinned commit; anything about server-side enforcement remains unverified here. A human should re-check both links against the current build, confirm which surfaces exist in their deployment, and review DEV's current AI-content policy before publishing.

The open question worth taking to your own runbook: which plane owns revocation — the directory, the grant list, or the enabled flag — and which of those three does your CI actually assert on?

This article was created with AI assistance. The team preparing material about MonkeyAI commissioned it.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.