langchain-ai/deepagents · error · SystemExit
Error: Could not revoke trust for: {target}
Error message
Error: Could not revoke trust for: {target} What it means
`skills trust revoke <target>` returns a `RevokeResult`; when it equals `RevokeResult.ERROR`, `_trust` prints `Error: Could not revoke trust for: <target>` and exits with status 1. The guard exists so the CLI fails loudly rather than emitting a success JSON envelope that scripts might misinterpret when the underlying store update fails.
Source
Thrown at libs/code/deepagents_code/skills/commands.py:951
for path, trusted_at in entries:
console.print(f" {escape(str(path))}")
if trusted_at:
console.print(
f" [dim]trusted {escape(trusted_at)}[/dim]", style=theme.MUTED
)
console.print()
elif command == "revoke":
target = args.dir
result = revoke_skill_dir_trust(target)
# An I/O/read failure is a hard error regardless of output format
# (matching `list`): print red and exit non-zero without emitting a
# success envelope a script might misread.
if result is RevokeResult.ERROR:
console.print(
"[bold red]Error:[/bold red] Could not revoke trust for: "
f"{escape(str(target))}"
)
raise SystemExit(1)
if output_format == "json":
from deepagents_code.output import write_json
write_json(
"skills trust revoke",
{"dir": str(target), "result": result.value},
)
return
# `ERROR` was handled above (early exit), so only `REMOVED`/`NOT_FOUND`
# remain. Match exhaustively with `assert_never` so adding a future
# `RevokeResult` member is a static error here rather than a silent
# success that prints nothing yet exits 0.
match result:
case RevokeResult.REMOVED:
console.print(
f"{checkmark} Revoked trust for: {escape(str(target))}",
style=theme.PRIMARY,
)View on GitHub (pinned to a1af029e6e)
Solutions
- Check that the trust store file is writable by the current user
- Run `skills trust list` to see the exact stored path and revoke that exact value
- If the store is corrupt, back it up, delete it, and re-add the entries you still trust
- Retry the revoke after fixing the filesystem issue
Example fix
// before $ dcode skills trust revoke ~/MySkills # stored as /home/me/myskills # Error: Could not revoke trust for: /home/me/MySkills // after $ dcode skills trust list # get the exact stored path $ dcode skills trust revoke /home/me/myskills
Defensive patterns
Strategy: validation
Validate before calling
from deepagents_code.skills.trust import _read_dirs
def is_trusted(target: str, store_path) -> bool:
return str(Path(target).resolve()) in dict(_read_dirs(store_path)) Try / catch
from deepagents_code.skills.trust import RevokeResult
result = revoke_skill_dir_trust(Path(target).resolve())
if result is RevokeResult.ERROR:
print(f'could not revoke trust for {target}; check store permissions')
raise SystemExit(1) Prevention
- Revoke the exact path shown by `skills trust list` (resolved, canonical form)
- Ensure the trust store file is writable before revoking
- Repair or recreate a corrupt store before further trust operations
- Avoid running the CLI under a different user than the profile owner
When it happens
Trigger: `skills trust revoke <dir>` when `revoke_skill_dir_trust` reports `ERROR` — typically the trust store could not be read or written (OSError, ValueError from `_load_store`, permissions), or the removal of the entry failed.
Common situations: Revoking trust while the trust store file is read-only or owned by another user; corrupted store content; revoking a path that was recorded under a different resolved form than the argument given.
Related errors
- Error: Could not read the skill trust store: {exc}
- Error: Could not clear trusted directories.
- dcode: {message}
- Could not resolve {label} path {raw_path!r}: {exc}. Ensure t
- Error: Source agent '{source_agent}' not found or has no AGE
AI-assisted analysis of langchain-ai/deepagents@a1af029e6e (2026-08-29).
Data as JSON: /api/errors/91752d0693095e41.
Report an issue: GitHub.