mjmirza/app-store-compliance is an App Store and Google Play rejection playbook (about 11k stars per the GitHub API on 2026-12-04). It ships data/rejection-patterns.json (128 patterns: 38 critical, 67 high, 23 medium), data/regulatory-deadlines.json (117 dated sources), and a single bash guard, agent-os/hooks/app-store-compliance-guard.sh (about 9,000 lines). This is a source reading at commit f6cb4a7, version 2.5.7. The license is the repo’s own OpenRoots ORA 2.3 (GitHub reports it as NOASSERTION), so read LICENSE before reusing code.
Companion tutorial: how to install and use it is on Cui.Guru: Stop your agent submitting a risky app build with app-store-compliance.
The workflow in motion
Architecture
One script serves two entry points. With a directory argument it is a standalone scanner. With no argument and piped stdin it is a hook: it parses the agent’s JSON payload, extracts the shell command, and decides whether that command submits a build. I ran both paths on a toy iOS folder: ls exited 0, fastlane deliver exited 2.
The rest of the repo is data and packaging around that script. The guard’s detection rules are hard-coded bash checks; it does not read rejection-patterns.json, which is reference material for the agent-led audit skill. It does read regulatory-deadlines.json for the freshness line and deadline status. scripts/install.sh copies the guard and skill into each tool’s own folder and edits that tool’s hook config; .claude-plugin/plugin.json registers the same script under PreToolUse with matcher Bash|PowerShell.
The class names are my modelling, not the repo’s; they summarise what the script’s data files and verdict lines contain.
The core design idea
The guard treats “I could not check” as a first-class outcome, not a pass. Four behaviours show it.
First, an unreadable readiness file blocks. The .app-review-readiness.json file records what only a person can prove (demo account, live backend, review notes). A fail blocks, and so does a file that exists but cannot be parsed, because “a fail inside it cannot be seen”:
# agent-os/hooks/app-store-compliance-guard.sh
finding critical "MANUAL-READINESS-UNREADABLE" ".app-review-readiness.json for $label${from} exists but is not a readable file, so a fail inside it cannot be seen" "Replace it with a regular file shaped like templates/app-review-readiness.json, or remove it."
Second, nothing scanned is NOT CHECKED, never CLEAR. Run by hand, that exits 1; as a hook it allows the command, unless APP_STORE_GUARD_BLOCK_UNCHECKED=1 is set.
echo ""; echo "$NOTE"; echo "$NEXT"
if [ -n "$STDIN_JSON" ]; then block_unchecked "$NOTE $NEXT"; emit_report 0; echo "$NOTE $NEXT" >&2; exit 0; fi
exit 1
Third, rule freshness is shown in every report. The script greps every verified_on date from regulatory-deadlines.json and prints the oldest and newest, then Rule pack STALE. when even the newest source is past APP_STORE_GUARD_STALE_DAYS (default 60); individual older records get a separate warning line. The checks are a dated snapshot, and the output says so.
Fourth, even a passing verdict is hedged:
echo "CLEAR. 0 critical risks in the code scan. Read any [HIGH] and [MEDIUM] lines above, then walk docs/PRE-SUBMISSION-CHECKLIST.md for the account and listing checks a scan cannot see."
The submit matcher is a single long regex, SUBMIT_RE, covering tools such as fastlane deliver, eas submit, xcrun altool, bundleRelease, flutter build ipa and more. Everything else exits early. Before matching, an awk pass blanks the quoted message of git commit and gh pr create, so a commit message that mentions “fastlane deliver” is not mistaken for a submit.
The override is deliberate and loud:
if [ "${APP_STORE_GUARD_OK:-0}" = "1" ]; then
echo "APP_STORE_GUARD_OK set. Critical findings present but the submission is allowed."
log_err "override used with $CRIT critical findings"
emit_report 0; exit 0
(The closing fi is omitted.)
The payload parser is defensive too: it tries jq, then python3, then a regex, and accepts many tool names (Bash, PowerShell, run_shell_command, execute_bash and others), and a payload it cannot parse yields no command, so the guard stays silent rather than guessing. There is also a Cursor-specific path that replies with a {"permission":"deny"} object instead of prose.
I ran the guard on a toy folder and a payload only. I did not run the installer against real tools or the full test suite.
Takeaways
- A gate should have three outcomes, blocked, clear and unknown, and print “unknown” when it is. Faking CLEAR trains users to ignore it.
- Put what a scanner cannot prove into a machine-readable file the same gate reads (
failblocks, and achecked_onolder than 30 days is flagged HIGH). - Date your sources (
verified_oninregulatory-deadlines.json) so staleness is measurable, even when the checks themselves are hard-coded. - One script behind many agents works if the hook payload parsing is tolerant and the override is explicit.
- Cheap early exit matters for a hook that fires on every shell command.
Want a custom guardrail hook for your own agents’ risky commands? Get in touch at cui.guru/contact.
Click to load Disqus comments