{"record":{"id":"6aa62f687f9b92d1","repo":"Hmbown/CodeWhale","slug":"agent-profile-may-not-request-allow-shell-true","errorCode":null,"errorMessage":"agent profile {} may not request allow_shell=true","messagePattern":"agent profile (.+?) may not request allow_shell=true","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/fleet/profile.rs","lineNumber":501,"sourceCode":"    tools: Option<&AgentProfileTools>,\n    permissions: Option<&AgentProfilePermissionsToml>,\n) -> Result<()> {\n    if let Some(posture) = tools\n        .and_then(|tools| tools.posture.as_deref())\n        .and_then(trimmed_non_empty)\n    {\n        match posture {\n            \"read-only\" | \"readonly\" | \"read_only\" => {}\n            other => bail!(\n                \"agent profile {} tools.posture={other:?} would widen permissions; use FleetProfile policy for grants\",\n                path.display()\n            ),\n        }\n    }\n\n    if let Some(permissions) = permissions {\n        if permissions.allow_shell.unwrap_or(false) {\n            bail!(\n                \"agent profile {} may not request allow_shell=true\",\n                path.display()\n            );\n        }\n        if permissions.trust.unwrap_or(false) {\n            bail!(\n                \"agent profile {} may not request trust=true\",\n                path.display()\n            );\n        }\n        if permissions.approval_required == Some(false) {\n            bail!(\n                \"agent profile {} may not disable approval_required\",\n                path.display()\n            );\n        }\n    }\n    Ok(())","sourceCodeStart":483,"sourceCodeEnd":519,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/fleet/profile.rs#L483-L519","documentation":"The permission-expansion guard for agent profiles rejects `allow_shell = true` outright. Agent profiles can only restrict; shell access is a FleetProfile-level grant, so an agent profile requesting shell access fails to load.","triggerScenarios":"An agent profile TOML containing `[permissions] allow_shell = true` (or omitting the key defaults to false so this only fires when explicitly true) passed through agent_profile_from_toml via the profile loader.","commonSituations":"Copying a workspace/FleetProfile permissions block into an agent profile; trying to give one agent shell access by editing its profile instead of policy; old example configs written before profiles were locked down.","solutions":["Set allow_shell = false or remove the allow_shell key from the agent profile","Grant shell access via the FleetProfile policy if that agent genuinely needs it","Split the agent into its own Fleet workspace with an appropriate policy instead of per-agent shell grants"],"exampleFix":"// before\n[permissions]\nallow_shell = true\n\n// after\n[permissions]\nallow_shell = false\n# shell grants configured at FleetProfile policy level","handlingStrategy":"validation","validationCode":"let allow_shell = profile.get(\"permissions\").and_then(|p| p.get(\"allow_shell\")).and_then(|v| v.as_bool()).unwrap_or(false);\nif allow_shell {\n    eprintln!(\"agent profile may not set allow_shell=true\");\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"allow_shell=true\") => {\n        eprintln!(\"remove allow_shell from the profile; grant shell via FleetProfile policy\");\n    }\n    other => other?,\n}","preventionTips":["Treat agent profiles as restriction-only: never set allow_shell, trust, or approval_required=false","Configure shell access once at the FleetProfile policy level"],"tags":["fleet","agent-profiles","permissions","shell"],"backgroundTag":"permission-denied","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}