Hmbown/CodeWhale · error
agent profile may not request trust=true
Error message
agent profile {} may not request trust=true What it means
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.
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
Example fix
// before [permissions] trust = true // after [permissions] trust = false
Defensive patterns
Strategy: validation
Validate before calling
let trust = profile.get("permissions").and_then(|p| p.get("trust")).and_then(|v| v.as_bool()).unwrap_or(false);
if trust {
eprintln!("agent profile may not set trust=true");
} Try / catch
match result {
Err(e) if e.to_string().contains("trust=true") => {
eprintln!("remove trust from the profile; trust is a FleetProfile policy grant");
}
other => other?,
} Prevention
- Never write trust=true in agent profile files
- Review permissions blocks when copy-pasting between policy and profile files
When it happens
Trigger: An agent profile TOML with `[permissions] trust = true` loaded through agent_profile_from_toml; only the literal true triggers this — absent or false passes.
Common situations: 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.
Understand the failure class
Background: Permission denied / not authorized / 403 Forbidden: access-control rejections when the caller lacks the required role, grant, or ownership — this error's family across 18 libraries.
Related errors
- agent profile may not disable approval_required
- agent profile may not request allow_shell=true
- agent profile tools.posture= would widen permissions; use…
- agent profile cannot be empty
- agent profile must be a simple token
AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22).
Data as JSON: /api/errors/5aecbd83e00de8e5.
Report an issue: GitHub.
Appendix: source
Thrown at crates/tui/src/fleet/profile.rs:507
{
match posture {
"read-only" | "readonly" | "read_only" => {}
other => bail!(
"agent profile {} tools.posture={other:?} would widen permissions; use FleetProfile policy for grants",
path.display()
),
}
}
if let Some(permissions) = permissions {
if permissions.allow_shell.unwrap_or(false) {
bail!(
"agent profile {} may not request allow_shell=true",
path.display()
);
}
if permissions.trust.unwrap_or(false) {
bail!(
"agent profile {} may not request trust=true",
path.display()
);
}
if permissions.approval_required == Some(false) {
bail!(
"agent profile {} may not disable approval_required",
path.display()
);
}
}
Ok(())
}
fn validate_agent_profile_token(path: &Path, field: &str, value: &str) -> Result<()> {
let trimmed = value.trim();
if trimmed.is_empty() {
bail!("agent profile {} {field} cannot be empty", path.display());View on GitHub (pinned to 73e0f67d83)