metraton/gaia/security-tiers
Claude Code and agent skill by metraton/gaia
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Use when classifying any operation before executing it, or deciding whether user approval is required
Install
npx vskill@latest install metraton/gaia/security-tiersSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as metraton/gaia/security-tiers.
Security Tiers
COMMAND_SET boundary
Classification applies to each exact atomic command. After read-only investigation, one or more predictable T3 commands may be requested plan-first with gaia approvals request-set -- a single predictable T3 command uses the same verb proactively, not only after the pre-execution policy gate returns [T3_BLOCKED]. Never discover a set by attempting a compound shell command. subagent-request-approval owns request construction and grouping; this skill owns the classification and no-elusion decision that routes work there.
security-tiers classifies every operation into four tiers so an agent knows whether it can run freely or must request the user's consent.
The validator model: a simple first line, walls behind it
The Bash classifier is the first line, and it is kept simple on purpose: the target walls below stand behind it, so a command it misreads still meets a wall at the thing that matters. It applies five rules; the sections after this one detail each lane.
- A closed change-verb lexicon. A word changes state only when it is in
hooks/modules/security/verb_lexicon.py::CHANGE_VERB_CLASSES-- five classes,create,update,delete,publishandexec-- whose union ishooks/modules/security/mutative_verbs.py::MUTATIVE_VERBS. A word outside it is not a change verb, soadd,commitandstashare free by elimination. The ambiguous wordsset,copy,start,tag,labelandannotate(verb_lexicon.py::AMBIGUOUS_VERBS) are relieved only on a family proven local,LOCAL_FAMILIES(docker), throughverb_lexicon.py::ambiguous_verb_relieved; an unmodelled CLI (rclone copy) is not proven local and signs. Inside the execution scan (rule 3) a lexicon verb counts only on a remote family (hooks/modules/security/execution_scan.py::REMOTE_FAMILIES: k8s, iac, git, cloud, workspace, package, system). - A closed exception table. The verb yields to the effect only in the shapes
verb_lexicon.py::EFFECT_OVER_VERB_EXCEPTIONSlists, each naming the symbol that decides it: a push of one's own non-default branch and a--ff-onlymerge in a managed worktree (mutative_verbs.py::_check_git_publish_relief), a localgit merge(mutative_verbs.py::_git_merge_is_local), a--ff-onlymerge to the branch's own remote ref (mutative_verbs.py::_git_local_sync), opening or editing a change request (verb_lexicon.py::CHANGE_REQUEST_OWN_WORK), andgaia approvals revoke|reject|reject-all|clean(mutative_verbs.py::CONSENT_REDUCING_SUBCOMMAND_EXCEPTIONS). Opening a change request is free on any repository; a local merge is free with only the plain flagsmutative_verbs.py::_GIT_LOCAL_MERGE_FLAGSlists (plus-m <msg>, or a bare--abort,--continue,--quit), while a strategy option (-s,-X) or an operand the shell computes (git merge $BRANCH) signs;pr mergesigns for every binary, and so does a change-request edit on another repository or with a retarget flag. "What reaches the remote" below gives each shape in full. - The word that decides what runs is literal. When the program word, or the verb word of a CLI that picks its action by word, is a shell expansion, the command asks as
unknown.dynamic-span(verbdynamic-programordynamic-verb; Step 0-dynamic inmutative_verbs.py::_detect_mutative_command, reading_literal_wordsand_dynamic_verb_span_word). - One short execution scan, depth 1.
execution_scan.py::scan_executionreads an execution's entry -- a script file, inline-c/-ecode, a heredoc program, a package script with itspre/postscripts, amaketarget orjustrecipe with its direct prerequisites,go run,cargo run-- and the literal local files it names, once each and never their own callees (at mostMAX_CALLEES, 32, each up toMAX_BYTES, 512 KiB).execution_scan.py::_signallooks for six signals: a change verb on a remote family (remote-change-verb,sign.lands); a write -- never a read -- onto a system, account or harness path (system-path,sign.system-pathorsign.lands-on-protected); a download piped into an interpreter (download-and-run,sign.foreign-code); code built at runtime, such asevalof a variable or animportwhose specifier is computed (runtime-code,sign.foreign-code); a recursive delete or truncate outside the project or Gaia scratch (destroys-outside,sign.destroys, measured againstexecution_scan.py::_kept_roots; a permanently blocked disk or delete command reports asfloorunder the same rule); data sent over the network (network-send,sign.speaks). The scan only adds asks (mutative_verbs.py::_check_execution_scan, run right after_detect_mutative_command): a verdict the older lanes already made mutative is kept unless its verb is one ofmutative_verbs.py::_NO_MODEL_VERBS-- an unresolvednpm/bun/pnpm/yarnrun, an unresolved frozen install, an unreadable script file -- and only such an ask is freed when the scan reads the entry with no signal, never one whose entry is inline code. A file read only in part (over the size cap or not UTF-8) asks aspartial-read(unknown.dynamic-span), and an entry that runs a local path the scan cannot read keeps the older verdict. - Reads are free, except secrets and the store. What changes nothing is free by elimination (
hooks/modules/security/tiers.py::_classify_command_tier_cached). Reading where secrets live is refused (hooks/modules/security/sensitive_read_guard.py::check), and so is anysqlite3read of Gaia's store or Python that reaches it in-process (hooks/modules/security/gaia_db_write_guard.py::check, which callshooks/modules/security/store_code_guard.py::check);gaia context queryopens the store read-only.
The target walls behind those rules:
- Running as another user signs.
sudo,suanddoas, past assignments and transparent wrappers, ask undersign.privilege, while the payload still meets every floor (hooks/modules/security/privilege_guard.py::privilege_verdict). - A shell write onto a system path signs. A writer whose target resolves under
/etc,/usror/bootasks undersign.system-path(hooks/modules/security/shell_write_guard.py::system_path_target, called fromhooks/modules/tools/bash_validator.py). - The real store is written only by Gaia's entry points.
gaia/store/writer.py::real_store_refusalrefuses a write to the account's realgaia.db, creating a missing one included, from any process thatgaia/store/writer.py::_runs_as_entry_pointdoes not recognize:bin/gaia, whosemainsetsGAIA_STORE_ENTRY_POINTso a subcommand such asgaia scanand every child it starts inherit it; ahooks/*.pyentry;opencode/bridge.py. A pytest run never writes it. This is an accidental-write wall against stray scripts and tests, not a privilege boundary: code running as the user can still pass as an entry point. - Session start checks the install.
hooks/modules/session/install_integrity.py::integrity_noticecompares the install links and Gaia's settings keys with the hashes the install manifest recorded and reports drift under## Install integrity(hooks/modules/session/session_lifecycle.py::_install_integrity_notice). It is a notice, never a block.
Concealment is not chased in the parser. The scan and the verb rules read only what the text shows literally; a signal behind a variable, a helper of a helper or a computed name is not followed (the header of execution_scan.py::REMOTE_FAMILIES states it). That case belongs to the walls above and to the no-elusion rule below, not to a longer parser. Every validator change lands behind a replay with friction caps set beforehand. tests/replay/test_validator_replay_diff.py::test_the_working_tree_validator_stays_within_the_friction_caps, selected with -m replay, runs tools/validator_replay/replay.py::run to classify the truth table, real command history, approvals and curated cases with the merge-base validator and the working tree; tools/validator_replay/replay.py::check_caps fails the run when the difference exceeds tools/validator_replay/caps.json. A change to a pinned truth row or curated case (replay.py::PINNED) passes only when its task declares it in tools/validator_replay/declared/<task>.json and the run is pointed at that file with GAIA_REPLAY_DECLARED (read by the test and passed to replay.py::run; unset, nothing is declared), and a verdict that loosens needs a named review there.
The four tiers
| Tier | What it is | Approval? | Example verbs | |
|---|---|---|---|---|
| T0 | Read-only; observes state, changes nothing | No | get, list, describe, show, logs, status | |
| T1 | Local validation; no remote calls, no state | No | validate, lint, fmt, check | |
| T2 | Simulation / dry-run; may read remote, never writes | No | plan, diff, --dry-run, template | |
| T3 | State-mutating; creates, updates, or destroys | Yes | apply, create, delete, push, deploy |
A fifth verdict exists OUTSIDE this ladder: the categorical denial -- blocked commands, the .claude/hooks tree targeted through Bash (hooks/modules/security/protected_path_guard.py::check), the DB-write guards (the sqlite3 CLI aimed at gaia.db, whatever its SQL, and any shell writer -- copy, move, redirect, tee, dd of=, truncate, a mutative inline interpreter -- whose destination is the gaia.db file, hooks/modules/security/gaia_db_write_guard.py::check), a file write into a git working tree whose author is the SHELL (hooks/modules/security/shell_write_guard.py::check), and reading or listing a path where secrets live -- credential directories and files, .env files, the key patterns -- through Bash (hooks/modules/security/sensitive_read_guard.py::check) or Read, Glob, Grep and OpenCode's list (check_file_tool in the same module), and a git push of a branch whose net comment and docstring lines exceed the limit (hooks/modules/security/comment_push_gate.py::check, measured by gaia lint comments; it fails open with a warning when the counter errors; a --help, -h or --dry-run push publishes nothing and is not measured). It is not a tier, it is not approvable, and no grant lifts it. The secret-read refusal is categorical because a signature would only put the credential's contents into a transcript. A body file handed to a publishing command (--body-file, -F, --description-file, --notes-file, git commit -F, for any forge binary) that resolves to a secret is a secret read and is refused the same way.
The gaia.db guard (`gaia_db_write_guard.py::check`) runs `sqlite3` only inside an allowlisted subset whose reach it can prove from the line, and refuses every other call categorically. The subset proves where a call can land, not that it only reads: it admits INSERT, UPDATE, DELETE and CREATE/DROP of a table, index or view on a database other than gaia.db, and every call inside it signs. The proof comes from the content the line shows: what that content proves sqlite3 can reach decides the verdict, and the program's name decides nothing. On a line that runs sqlite3 (directly, behind a wrapper, through xargs or a shell's -c):
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/security-tiers/SKILL.md
Popularity
- Repository stars
- 3
- Repository forks
- 1
- 7-day trend score
- 7
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/metraton/gaia/security-tiers)