AI disclosure: this article was produced with AI assistance. A human must verify every claim, the cited source behavior, and DEV's current policy before publishing. Coverage note: the team preparing material on MonkeyAI commissioned this article. No probe described below was executed, and no cost figure here is a measurement.
An illustrative setup, not an incident report
The following sequence is constructed to show a failure shape. It is not an observed incident.
A platform engineer opens the admin model page. The shared model shows an empty group list and an empty member list. The enable toggle reads off.
They flip the toggle, save, and post 'model is live for platform' in the channel. Two days later the cost graph steps up. Nobody can tie that step to a config revision.
Three questions stay unanswered:
- Can the intended members actually call the model?
- Can members outside the grant also call it?
- How many callers did the grant just authorize at peak?
What the MonkeyAI source actually separates
The self-host guide treats member creation and model access as two steps. Read that section before planning any grant: README, self-host MonkeyAI.
The model editor keeps three things apart. It maps authorization.group_ids into groupIds and authorization.user_ids into memberIds. Missing lists become empty arrays, and the enabled flag is read on its own: models-page.tsx L319-L325.
Read that mapping for what it is. It describes editor state. It does not describe the server's access-control decision.
So a zero-length array is not proof that nobody has access. A toggle position is not proof that enforcement changed. Treat both as inputs to a test, not as the test.
Prerequisites before you touch the toggle
- Permission to edit the model authorization you intend to change, not only read access. The grant in Step 5 changes admin state.
- A way to sign in as one canary identity per target group in an approved client.
- A second test identity that is outside the target groups, for the negative case.
- A usage or telemetry record that carries caller identity, not just a total.
- A median token count per request from your own history.
- A named revision marker for the config, such as a commit or export timestamp.
Without caller-level telemetry, the drill produces no attribution. Without a token baseline, the arithmetic below is fiction.
Step 1: Write the fan-out estimate first
Estimate the peak request surface the grant could authorize. Use placeholders only until you replace every value.
# illustrative placeholders, not measured values group_members = 40 requests_per_member = 6 # per hour, from your own 7-day history peak_hours = 3 peak_requests = 40 * 6 * 3 # 720 median_tokens = ? # per request, from your own usage records peak_tokens_estimate = 720 * median_tokens This is a planning estimate, not an upper bound. It omits retries and multi-turn conversations, so real load can exceed it. If your client retries failed calls, check the retry policy explicitly; retries add load to an already overloaded dependency, and backoff or jitter changes timing rather than proving headroom (AWS Builders' Library). State any retry multiplier as an assumption, not a measurement.
Then answer the threshold question in writing. At what peak multiplier do you require a per-group quota, and why that number? A defensible answer names the daily budget line and the deadline slack you refuse to lose.
Step 2: Pick one canary per group
A canary is one real member identity, not a shared service account. Shared accounts collapse attribution and hide drift.
Choose members whose usage you can recognize in telemetry. If you cannot recognize them, fix that before the grant.
Step 3: Probe as the canary and record fields
This is a planned observation, not a runnable client and not an executed test.
Inputs: the model identifier, the current config revision, one canary member per target group, and one minimal prompt.
Procedure: sign in as the canary in your approved client, select the model, and send the prompt. Record the config revision, model identifier, caller identity, group, status, input and output token counts, and timestamp. Use the client and the usage record, not only the admin page.
What to observe: the call should return a response, and the usage or telemetry record should attribute that request to the canary identity. If the call succeeds but the usage record does not identify the caller, you have a telemetry gap; fix it before widening the grant. If the call fails even though the model is enabled and the canary is intended to have access, check the guide's enabled/accessibility conditions and your deployment logs; do not treat the form as proof of server enforcement.
A one-word prompt keeps probe cost small. That same property makes probe tokens a poor proxy for production tokens. Never scale a probe result straight into a budget.
Step 4: Prove the negative case
A successful call proves reachability. It does not prove the gate.
Probe one member who should not have access. Use the out-of-scope identity from the prerequisites. Record the rejection status and the timestamp. Observe whether the call is rejected under the current revision. If that member succeeds, stop. The grant is broader than the form suggested, the test identity is actually in scope, or both; either way, widening it further changes nothing you can describe.
Step 5: Widen the grant, then re-probe
Apply the group grant in the admin interface or deployment process; this requires write access. Record or bump the config revision at the same moment.
Repeat the same observation procedure against the new revision. Compare two things:
- the set of canaries that succeed now versus before;
- the rejection status for the out-of-scope member.
A success set that grew unexpectedly is an authorization problem and a cost risk. Stop and investigate before trusting the grant.
Step 6: Rollback that someone can actually perform
Rollback is an authorization change. It is not a memory of the old toggle.
Write down three things before the change:
- The exact model and the exact authorization values you are replacing: enabled state,
group_ids, anduser_ids. - The revision marker that identifies the previous state.
- The person who can apply it outside working hours.
After rollback, repeat the canary and negative probes against the restored state. Keep the probe log on the same timeline as your cost graph. Without a revision marker next to the cost step, attribution is guesswork.
Common failure modes
- Reading
[]as deny. The editor substitutes an empty array when a list is missing. That is form behavior, not a policy statement. - Reading the toggle as enforcement. The enabled flag and the authorization lists are separate fields. Neither one is the server's decision.
- Granting to a group whose size you never counted. The estimate is only as good as the member count you refuse to guess.
- Group membership drift. Members added to a granted group later may inherit the grant without a second form edit. Verify this against your own deployment rather than assuming either way.
- Probe cost confused with production cost. Small prompts make cheap probes and bad budgets.
- Cost step with no revision on the timeline. You will blame the deploy instead of the access change.
How to check the outcome
- Every canary probe carries the canary's identity in the usage record.
- The out-of-scope member is rejected at both revisions.
- The observed request volume stays within the planning estimate plus any stated retry assumption.
- The cost graph step aligns with the revision timestamp, not with a vague deploy window.
- Rollback restores the previous enabled state and authorization lists, confirmed by a repeat canary probe and the negative probe.
Tradeoffs
Group grants are cheap to operate and coarse for cost control. One edit covers a whole team, and one edit also multiplies the potential peak request surface.
Per-member grants are precise and drift-prone. They cost you an edit per hire and an audit per quarter.
Canary probes cost a few requests each. Skipping them costs an unattributable step in a graph nobody can defend later.
When this does not apply
This drill adds little when a single small team owns one model and one budget. There is no fan-out to estimate and no group boundary to test.
It also adds little when your platform already records per-caller usage you can reconcile after the fact. In that case, run the reconciliation and skip the canary ceremony.
The drill does not certify security. It tests reachability and gives you a number to argue about. Access review and enforcement testing remain separate work with separate evidence.


