{"record":{"id":"5aecbd83e00de8e5","repo":"Hmbown/CodeWhale","slug":"agent-profile-may-not-request-trust-true","errorCode":null,"errorMessage":"agent profile {} may not request trust=true","messagePattern":"agent profile (.+?) may not request trust=true","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/fleet/profile.rs","lineNumber":507,"sourceCode":"    {\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(())\n}\n\nfn validate_agent_profile_token(path: &Path, field: &str, value: &str) -> Result<()> {\n    let trimmed = value.trim();\n    if trimmed.is_empty() {\n        bail!(\"agent profile {} {field} cannot be empty\", path.display());","sourceCodeStart":489,"sourceCodeEnd":525,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/fleet/profile.rs#L489-L525","documentation":"Agent profiles may not request trust=true; trust is the highest permission tier and can only come from FleetProfile policy. The loader rejects any agent profile file that sets permissions.trust = true.","triggerScenarios":"An agent profile TOML with `[permissions] trust = true` loaded through agent_profile_from_toml; only the literal true triggers this — absent or false passes.","commonSituations":"Copy-pasting a FleetProfile permissions section into an agent profile; attempting to auto-trust one agent by editing its profile; migrating an old config where trust was per-agent.","solutions":["Remove the trust key or set trust = false in the agent profile","Configure trust at the FleetProfile policy level for workloads that need it","Re-run with the profile reduced to restrictive permissions"],"exampleFix":"// before\n[permissions]\ntrust = true\n\n// after\n[permissions]\ntrust = false","handlingStrategy":"validation","validationCode":"let trust = profile.get(\"permissions\").and_then(|p| p.get(\"trust\")).and_then(|v| v.as_bool()).unwrap_or(false);\nif trust {\n    eprintln!(\"agent profile may not set trust=true\");\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"trust=true\") => {\n        eprintln!(\"remove trust from the profile; trust is a FleetProfile policy grant\");\n    }\n    other => other?,\n}","preventionTips":["Never write trust=true in agent profile files","Review permissions blocks when copy-pasting between policy and profile files"],"tags":["fleet","agent-profiles","permissions","trust"],"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"}