langchain-ai/deepagents · error · SystemExit

Error: Could not read the skill trust store: {exc}

Error message

Error: Could not read the skill trust store: {exc}

What it means

The `skills trust list` subcommand reads the on-disk skill trust store via `list_trusted_skill_dir_entries(strict=True)`. If that raises `OSError` (unreadable/corrupt file, bad permissions) or `ValueError` (malformed store), `_trust` prints `Error: Could not read the skill trust store: <exc>` and exits with status 1. Strict mode is used so a corrupt store is reported rather than silently treated as empty.

Source

Thrown at libs/code/deepagents_code/skills/commands.py:908

        revoke_skill_dir_trust,
    )

    command = getattr(args, "trust_command", None)
    output_format = getattr(args, "output_format", "text")
    checkmark = get_glyphs().checkmark

    if command in {"list", "ls"}:
        # Read strictly so an unreadable store surfaces as an error instead of
        # falsely reporting "No trusted skill directories" — the whole point of
        # the audit command is to show what is trusted so it can be revoked.
        try:
            entries = list_trusted_skill_dir_entries(strict=True)
        except (OSError, ValueError) as exc:
            console.print(
                f"[bold red]Error:[/bold red] Could not read the skill trust "
                f"store: {escape(str(exc))}"
            )
            raise SystemExit(1) from exc
        if output_format == "json":
            from deepagents_code.output import write_json

            write_json(
                "skills trust list",
                [
                    {"dir": path, "trusted_at": trusted_at}
                    for path, trusted_at in entries
                ],
            )
            return
        if not entries:
            console.print()
            console.print("[yellow]No trusted skill directories.[/yellow]")
            console.print(
                "[dim]Directories are trusted when you approve a skill that "
                "resolves outside the standard skill roots.[/dim]",
                style=theme.MUTED,

View on GitHub (pinned to a1af029e6e)

Solutions

  1. Read the exception detail to determine if it is a permission problem or malformed content
  2. Fix file permissions on the trust store file if the error is EACCES
  3. If the store is malformed or from a newer build, back it up and delete it, then re-trust directories with `skills trust add`
  4. Verify you are not running an older build against a store written by a newer version

Example fix

// before
$ dcode skills trust list
# Error: Could not read the skill trust store: Skill trust store ... has an unrecognized schema version ...
// after (after backing it up)
$ mv ~/.deepagents/skills/trust.json ~/.deepagents/skills/trust.json.bak
$ dcode skills trust add ~/my-skills
Defensive patterns

Strategy: try-catch

Validate before calling

import json
from pathlib import Path

def trust_store_readable(store: Path) -> bool:
    try:
        return isinstance(json.loads(store.read_text(encoding='utf-8')), dict)
    except (OSError, ValueError):
        return False

Try / catch

try:
    entries = list_trusted_skill_dir_entries(strict=True)
except (OSError, ValueError) as exc:
    print(f'could not read trust store: {exc}')
    raise SystemExit(1) from exc

Prevention

When it happens

Trigger: `skills trust list` (or its `ls` alias) when the trust store file cannot be read: file missing permissions, I/O error, JSON that is not an object, or unrecognized schema version (ValueError from `_load_store` in strict mode).

Common situations: Trust store corrupted by manual editing or a partial write; schema written by a newer build; store file permissions broken after copying a profile directory between machines or users.

Related errors


AI-assisted analysis of langchain-ai/deepagents@a1af029e6e (2026-08-29). Data as JSON: /api/errors/c2edbd8ff30cee6a. Report an issue: GitHub.