技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
snowflake-governance-coverage-auditor【数据与研究】Audit trusted Snowflake classification, tags, masking, row access, projection, join, aggregation, and privacy-policy evidence without reading customer data. Use when governance enforcement may be missing or ambiguous. Trigger with "Snowflake governance coverage", "policy precedence", "tag policy gaps", "classification failure", or "POLICY_CONTEXT ver…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Compare an owner-approved hashed denominator with trusted schema-2 current
receipts and separately trusted, sanitized POLICY_CONTEXT simulations. Missing,
stale, capped, privilege-filtered, unsupported, or context-mismatched evidence is
never a pass; the result distinguishes observable coverage from evidence gaps
without exposing governed data or claiming compliance.
Read the input contract and the source notes before assembling evidence.
Use Python 3.10+, an owner-approved hashed denominator, and an existing Snowflake CLI read-only profile. Establish independent evidence and policy trust boundaries before analysis; do not accept credentials, raw identifiers, policy text, tag values, customer rows, or ad hoc SQL.
Have the governance owner approve the exact asset and simulation denominator.
Collect one classification receipt per database and one tag plus one policy receipt per governed object. Use fixed unquoted selectors only:
python3 "${CLAUDE_SKILL_DIR}/scripts/collect_snowflake_evidence.py" \
--surface governance-classification-current --connection readonly-observer \
--governance-database GOVERNED_DB --output ./classification.json
python3 "${CLAUDE_SKILL_DIR}/scripts/collect_snowflake_evidence.py" \
--surface governance-tags-current --connection readonly-observer \
--governance-object GOVERNED_DB.GOVERNED_SCHEMA.GOVERNED_TABLE \
--governance-domain TABLE --output ./tags.json
python3 "${CLAUDE_SKILL_DIR}/scripts/collect_snowflake_evidence.py" \
--surface governance-policies-current --connection readonly-observer \
--governance-object GOVERNED_DB.GOVERNED_SCHEMA.GOVERNED_TABLE \
--governance-domain TABLE --output ./policies.json
Independently verify the collection role's complete visibility over exactly
those hashes and produce the scope receipt. Execute the approved
POLICY_CONTEXT cases outside this collector; retain only the strict hash-only
receipt contract. Never add EXECUTE USING to the shared collector.
Record evidence and policy digests at their independent trusted boundaries:
# Record only at trusted local boundaries.
python3 "${CLAUDE_SKILL_DIR}/scripts/analyze_governance.py" evidence.json \
--print-input-sha256
python3 "${CLAUDE_SKILL_DIR}/scripts/analyze_governance.py" evidence.json \
--policy-file policy.json --print-policy-sha256
Analyze only with the previously recorded digests and policy-bound clock:
# Replace the quoted placeholder with the owner-policy timestamp.
python3 "${CLAUDE_SKILL_DIR}/scripts/analyze_governance.py" evidence.json \
--policy-file policy.json --evaluated-at "YYYY-MM-DDTHH:MM:SSZ" \
--trusted-input-sha256 sha256:RECORDED_EVIDENCE_DIGEST \
--trusted-policy-sha256 sha256:RECORDED_POLICY_DIGEST --pretty
Recomputing a digest from suspect evidence is not trust. Preserve every finding, precedence observation, non-claim, and the dry-run remediation packet.
CREATE OR REPLACE profile operations can detach automatic
classification and must be reviewed separately.ACTIVE provider status, including a missing conditional
masking secondary argument, is a gap.WHERE exposure.The collector uses reviewed SELECT statements only; it does not execute
POLICY_CONTEXT, mutation SQL, shell payloads, or network operations. Receipts and
reports contain only organization/account-scoped hashes, fixed enums, timestamps,
counts, and booleans. Never collect policy bodies, tag values, names, customer
rows, SQL text, errors, secrets, or query results. Exit 2 is a fixed generic
invalid-evidence error and never reflects rejected input.
Every remediation item has mutation_sql: null and
requires_separate_authorization: true. The skill never applies tags, policies,
profiles, grants, feature flags, or edition changes.
Exit 2 means the evidence, policy, trust digest, freshness, context, cap, or
schema check failed. The fixed error intentionally omits rejected values. Recheck
the independent denominator and recollect; never infer health or escalate roles.
An inherited required tag plus one ACTIVE applicable policy and a matching simulation can support bounded coverage. A missing secondary masking argument, newer failed classification attempt, unverified preview, or missing scope receipt produces a fixed hash-scoped gap and a non-executable remediation item.