Four agent-native, read-only trust-recon CLI tools covering the flatpak sandbox trust surface — the layer that tells you whether a box's flatpak installation and sandbox posture can still be TRUSTED (an operator whose runtime installation, remotes, overrides, ref-file grammar, portal wiring, deploy history and removal trail cannot be honestly censused has no flatpak trust story at all): the runtime + installation posture layer, the .flatpakref/.flatpakrepo installer-grammar layer, the sandbox override + portal-posture layer, and the deploy-history + removed-trail layer. Each tool parses documented grammar and stats binaries/dirs/files — nothing is ever executed, no bundle payload is ever parsed, no flatpak daemon is ever touched, and no remote URL, gpgkey payload, credential value or identifying filename ever prints raw.
flatpakpeek — flatpak runtime + installation posture census: flatpak-family binaries stat-listed on the lookup dirs (TOOL_BINS rows, BIN1/BIN2/BINN identity tokens, binaries never executed nor opened; BWRAP posture row) + canary-law proof that no content was read; install root top classes app/runtime/repo/exports/overrides/system-helper as INSTALL rows (presence + entry counts + permission classes, EMPTY_RUNTIME / EMPTY_OVERRIDES honest notes); OSTree-shaped repo config with [remote "NAME"] REMOTE rows (NAMES ride REMOTE tokens unless the public shape flathub; url= values never raw via URL tokens; gpgkey= values never read — REMOTE_GPGKEY presence rows only; collection-id presence; username / password / token KEY-PRESENCE rows with values dropped); overrides dir stat rows (APP tokens unless the com.example.* public shape, contents never read); findings BARE_TOOL / NO_REMOTES / CONFIG_WITHOUT_TOOL / OVERRIDE_PERM (group/world-writable overrides dir or entry) / CONFIG_PERM (world-writable repo config); rc 0 clean / 4 findings / 6 nothing readable / 3 usage.
flatpakrefpeek — .flatpakref/.flatpakrepo installer-grammar census: ref files stat-listed in the lookup dirs (REFFILE rows, REF1/REF2/REFN identity tokens, ext + mode + size; filenames are identities and never print raw, not even inside a path); INI grammar parsed as data ([Flatpak Ref] / [Flatpak Repo] GRAMMAR_SECTION rows; Url= never raw via URL tokens; GPGKey= values never read via GPGKEY_PRESENT presence rows; Title/Comment ride TEXT tokens unless empty; Branch public vocab stable/beta/master/test prints, custom rides BR tokens; non-public Runtime= rides CUSTOM_RUNTIME notes with tokenized values; username / password / token KEY-PRESENCE rows with values dropped; Version/Sdk/Homepage/IsRuntime/NoRuntime presence rows) + stat-only *.flatpak bundle census (BUNDLE rows with BNDL tokens + zero/small/medium/large size classes, contents never parsed); findings UNSIGNED_REF (Url= with no GPGKey=) / UNPARSEABLE_REF / REF_PERM (group/world-writable files); rc 0 clean / 4 findings / 6 nothing readable / 3 usage.
flatpakpermpeek — sandbox override + portal-posture census: walks the system + user override roots (/var/lib/flatpak/ overrides, ~/.local/share/flatpak/overrides) stat-only (OVERRIDE rows: app identities ride APP tokens, mode + perm class); parses override text SHAPE-only as INI ([Context] keys sockets/devices/ filesystems/features/shared ride OVRGRAMMAR rows; host/home/all values print, every other value rides PATH tokens; devices=all fires DEV_ALL; [Session Bus Policy]/[System Bus Policy] keys ride APP tokens with none/see/talk/own printing); rides KEY-PRESENCE rows for username/password/token shaped keys (values never read); censuses *.portal files (gtk/gnome/kde print, custom ride APP tokens) plus the system config dir (counts + perm class, file names never carried); group/world-writable override dir or file fires OVR_PERM, world-writable portal fires PORTAL_PERM, world-writable config fires SYSCONF_PERM, non-INI lines fire UNPARSEABLE_OVR / UNPARSEABLE_PORTAL; BINARY-free by construction.
flatpakhistpeek — deploy-history + removed-trail census: walks the install-root deploy layout (app/ + runtime/ deploy counts, per-deploy branch subdirs; app identities ride APP tokens, branches stable/beta/master print, custom ride BR tokens); refs census over repo/refs (ref file counts + shape classes; identities ride REFX tokens; contents NEVER parsed); .removed/ pending-delete census (entry counts + perm classes, names ride E tokens); mtime age buckets only (<7d / 7-30d / >30d — no clock values printed); orphan findings pair deploy dirs against ref files through token maps (ORPHAN_DEPLOY / ORPHAN_REF, never raw id equality); group/world-writable deploy dirs fire DEPLOY_PERM, world-writable removed entries fire REMOVED_PERM; EMPTY_REMOVED / EMPTY_DEPLOY / BARE_INSTALL / REFS_UNREADABLE honest notes.
The contract
Every tool: rc0 clean / rc4 findings / rc6 honest nothing-readable / rc3 bad usage (argparse subclass law); --json emits exactly one report object with the keys data/findings/notes/rc/summary/tool; the default mode prints one human summary line plus capped findings rows. python3 -m cli_anything.<tool> [--json] with per-tool FLATPAK* env overrides (see each SKILL.md). Pure Python stdlib — zero spawned lines, zero writes, zero network; binaries are name-searched and statted once and never run, bundle payloads are only size-classed, and nothing is ever executed. No ref, override, portal or config file is ever opened for writing; no credential value, remote URL payload or identifying app id is ever printed (APP1/REMOTE1/URL1/PATH1/REF1/BNDL1 class tokens only). The census never "fixes" a posture — it names it.