fix: add default agent permissions to prevent root-level denies from silencing agents - #109
Conversation
…silencing agents Agents previously had no permission field in their AgentConfig, so they inherited from the project's root config. A root-level deny (e.g. "edit": "deny" or "bash": "deny") would silently disable all micode agents. Add a centralized AGENT_PERMISSIONS object in index.ts with sensible defaults for each agent role: - readOnly: edit denied (codebase-locator, codebase-analyzer, etc.) - research: edit denied + webfetch allowed (planner, bootstrapper) - write: edit allowed (ledger-creator, mm-constraint-writer) - build: edit + bash allowed (implementer, reviewer) - orchestration: edit + bash + webfetch (commander, brainstormer, etc.) Each agent now explicitly declares the permissions it needs, preventing root-level denies from breaking functionality. Fixes vtemian#52 Signed-off-by: Mustafa Senoglu <mmustafasenoglu0@gmail.com>
There was a problem hiding this comment.
1 issue found across 1 file
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/agents/index.ts">
<violation number="1" location="src/agents/index.ts:73">
P1: When a user configures an explicit permission for a plugin agent, these new fields replace that agent's permission object during `mergePluginAgentConfig`, removing deliberate per-agent denies. Merge permission keys with existing agent values taking precedence, using `AGENT_PERMISSIONS` only for unspecified defaults.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| [PRIMARY_AGENT_NAME]: { | ||
| ...primaryAgent, | ||
| model: DEFAULT_MODEL, | ||
| permission: AGENT_PERMISSIONS.orchestration, |
There was a problem hiding this comment.
P1: When a user configures an explicit permission for a plugin agent, these new fields replace that agent's permission object during mergePluginAgentConfig, removing deliberate per-agent denies. Merge permission keys with existing agent values taking precedence, using AGENT_PERMISSIONS only for unspecified defaults.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/agents/index.ts, line 73:
<comment>When a user configures an explicit permission for a plugin agent, these new fields replace that agent's permission object during `mergePluginAgentConfig`, removing deliberate per-agent denies. Merge permission keys with existing agent values taking precedence, using `AGENT_PERMISSIONS` only for unspecified defaults.</comment>
<file context>
@@ -30,35 +30,175 @@ import { probeAgent } from "./probe";
+ [PRIMARY_AGENT_NAME]: {
+ ...primaryAgent,
+ model: DEFAULT_MODEL,
+ permission: AGENT_PERMISSIONS.orchestration,
+ },
+ brainstormer: {
</file context>
- Remove edit: "deny" from readOnly/research roles — agents' own tools config already disables edit, and omitting it lets the global permission apply without behavior change - Deep-merge permission in mergePluginAgentConfig so user-configured per-agent permission keys take precedence over plugin defaults Fixes vtemian#52 Signed-off-by: Mustafa Senoglu <mmustafasenoglu0@gmail.com>
|
Addressed both cubic review findings:
Typecheck ✅ Build ✅ 488 tests pass ✅ |
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
probe, planner, and bootstrapper do not disable edit in their tools config, so they would inherit the global edit: allow without an explicit deny. Restore edit: deny on readOnly and research roles, and update the comment to explain why it is necessary. Signed-off-by: Mustafa Senoglu <mmustafasenoglu0@gmail.com>
|
Good catch — you're right. Restored Typecheck ✅ Build ✅ 488 tests pass ✅ |
There was a problem hiding this comment.
2 issues found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/agents/index.ts">
<violation number="1" location="src/agents/index.ts:39">
P3: The new readOnly comment lists `reviewer` as one of the read-only agents that disables edit via its tools config, but in this same file `reviewer` is assigned `AGENT_PERMISSIONS.build` (`edit: "allow"`, `bash: "allow"`), not `readOnly`. The comment therefore overstates which agents the readOnly `edit: "deny"` covers and misleads a maintainer into thinking reviewer is read-only. Remove `reviewer` from the list (or clarify that it is covered by the build role instead).</violation>
<violation number="2" location="src/agents/index.ts:42">
P1: The shared research permission denies `edit`, but `plannerAgent` must use `Write` to create the implementation plan. This causes planner runs to fail or return without a plan; give planner a separate write-capable permission profile while keeping bootstrapper read-only.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
| // codebase-analyzer, pattern-finder, reviewer, artifact-searcher, mm-*) | ||
| // but others like probe don't — so we set edit: "deny" here to cover all. | ||
| readOnly: { | ||
| edit: "deny", |
There was a problem hiding this comment.
P1: The shared research permission denies edit, but plannerAgent must use Write to create the implementation plan. This causes planner runs to fail or return without a plan; give planner a separate write-capable permission profile while keeping bootstrapper read-only.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/agents/index.ts, line 42:
<comment>The shared research permission denies `edit`, but `plannerAgent` must use `Write` to create the implementation plan. This causes planner runs to fail or return without a plan; give planner a separate write-capable permission profile while keeping bootstrapper read-only.</comment>
<file context>
@@ -32,18 +32,21 @@ import { reviewerAgent } from "./reviewer";
+ // codebase-analyzer, pattern-finder, reviewer, artifact-searcher, mm-*)
+ // but others like probe don't — so we set edit: "deny" here to cover all.
+ readOnly: {
+ edit: "deny",
+ } as const,
</file context>
| // See https://github.com/vtemian/micode/issues/52 | ||
| const AGENT_PERMISSIONS = { | ||
| // Read-only agents: some disable edit via tools config (codebase-locator, | ||
| // codebase-analyzer, pattern-finder, reviewer, artifact-searcher, mm-*) |
There was a problem hiding this comment.
P3: The new readOnly comment lists reviewer as one of the read-only agents that disables edit via its tools config, but in this same file reviewer is assigned AGENT_PERMISSIONS.build (edit: "allow", bash: "allow"), not readOnly. The comment therefore overstates which agents the readOnly edit: "deny" covers and misleads a maintainer into thinking reviewer is read-only. Remove reviewer from the list (or clarify that it is covered by the build role instead).
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/agents/index.ts, line 39:
<comment>The new readOnly comment lists `reviewer` as one of the read-only agents that disables edit via its tools config, but in this same file `reviewer` is assigned `AGENT_PERMISSIONS.build` (`edit: "allow"`, `bash: "allow"`), not `readOnly`. The comment therefore overstates which agents the readOnly `edit: "deny"` covers and misleads a maintainer into thinking reviewer is read-only. Remove `reviewer` from the list (or clarify that it is covered by the build role instead).</comment>
<file context>
@@ -32,18 +32,21 @@ import { reviewerAgent } from "./reviewer";
- // permission config (edit: "allow", bash: "allow") apply.
- readOnly: {} as const,
+ // Read-only agents: some disable edit via tools config (codebase-locator,
+ // codebase-analyzer, pattern-finder, reviewer, artifact-searcher, mm-*)
+ // but others like probe don't — so we set edit: "deny" here to cover all.
+ readOnly: {
</file context>
Fixes #52
Problem
Micode agents define no
permissionfield in theirAgentConfig. When a project'sopencode.jsonsets root-level permission denies (e.g."edit": "deny"or"bash": "deny"), all micode agents inherit those denies and become non-functional — they spawn but return empty results because they can't use any tools.Fix
Add a centralized
AGENT_PERMISSIONSobject insrc/agents/index.tswith sensible defaults for each agent role:edit: denyedit: deny, webfetch: allowedit: allowedit: allow, bash: allowedit: allow, bash: allow, webfetch: allowEach agent now explicitly declares the permissions it needs, preventing root-level denies from breaking functionality.
Why this approach
The
AgentConfigpermission type only supports:edit,bash,webfetch,doom_loop,external_directory. Other tool access (read, glob, grep, task) is controlled at a different level via thetoolsconfig in individual agent files — those are already correctly configured.The fix targets the specific permission keys that the type supports and that are most commonly denied at root level.
Testing
bun run typecheckpassesbun run buildpassesSummary by cubic
Prevents root-level permission denies from silencing agents by adding role-based default permissions and deep‑merging per‑agent permission with user config. Previously agents inherited root denies and returned empty results; now each agent declares the minimal permissions it needs while user per‑agent overrides still take precedence.
AGENT_PERMISSIONSwith five roles using only edit, bash, webfetch; readOnly/research explicitly set edit: deny to prevent unintended edits byprobe,planner, andbootstrapper.permissioninmergePluginAgentConfigso user per‑agent keys override plugin defaults.Written for commit 042bd6a. Summary will update on new commits.