DC agent-safety
Agent 安全防护体系——事件驱动拦截(Hook Engine)+ 三层护栏(输入/工具/输出)+ 迭代循环(Ralph Loop)+ 操作追踪(Operation Tracer)
Agent 安全防护体系——事件驱动拦截(Hook Engine)+ 三层护栏(输入/工具/输出)+ 迭代循环(Ralph Loop)+ 操作追踪(Operation Tracer)
As a process C 50/100 · Has gaps — weak spots: result and completion, when it triggers, inputs and preconditions
What is at stake
The skill contains fragments that, in the wrong hands, cost money or data. Below: what the installer risks and what the author should do.
The text contains phrases like "ignore previous instructions" or "you are now…". That is an attempt to hijack the agent: it may break your rules, the system limits or company policy.
An honest skill does not need them: state the role and the rules directly without overriding other instructions. Otherwise catalog scanners and corporate filters will block the listing.
Below is the worst case for this category. The finding here is medium: the guard saw a sign, not a proof.
The files contain someone else's key or token. If it is live, your agent will call third-party services under a stranger's identity; if it was revoked, the skill's scripts simply fail. Such a key often arrives with the author's whole workspace, personal data included.
The key is visible to everyone who downloaded the skill and has likely been copied by catalog-scanning bots already. Revoke it now, check bills and access logs, then reissue.
How to improve
- Address the high-severity findings: each costs 18 safety points. If one is a false positive, add the rule id to guard.allow in spec.yaml.
- Say in the description WHEN to use the skill ("use when…", example requests): that is the agent's main cue.
- Your own cases (evals/evals.json, 4–6 real requests with expected answers): the full check would then run those instead of a model-drafted suite.
- A spec.yaml with trigger phrases and assertions — a behaviour contract for CI; `skilltest init` writes a template.
Guard findings · 24
-
high Instruction override
en-ignore-previousSKILL.md:203Instruction-override phrase ("ignore previous instructions")| 1 | ignore previous instructions | "ignore previous instructions and..." |
-
high Instruction override
en-ignore-previousSKILL.md:204Instruction-override phrase ("ignore previous instructions")| 2 | ignore above instructions | "ignore all above instructions" |
Medium and low: 22
-
medium Instruction override
en-ignore-previousreferences/injection_patterns.md:9Instruction-override phrase ("ignore previous instructions") (documentation of a security skill)### 1. ignore previous instructions
security skill -
medium Instruction override
en-ignore-previousreferences/injection_patterns.md:21Instruction-override phrase ("ignore previous instructions") (documentation of a security skill)### 2. ignore above instructions
security skill -
medium Secrets in code
secret-private-keyscripts/test_guardrails.py:153Private key material (key header without key body; test fixture / example file; quoted — discussed, not commanded)("private_key = -----BEGIN PRIVATE KEY----- …header onlyfixturequoted -
medium Instruction override
en-fake-system-promptSKILL.md:207Fake system prompt injected into content (documentation table row)| 5 | system prompt | "system prompt override" |
table -
medium Secrets in code
secret-private-keySKILL.md:236Private key material (key header without key body; documentation table row)| 5 | 私钥 | `private_key=xxx`, `-----BEGIN PRIVATE KEY----- …
header onlytable -
low Secrets in code
secret-password-literalscripts/guardrail.py:81Hard-coded password / key literal (may be an example) (placeholder value)result = guardrails.check_output("Here is the API_KEY=sk-1…def")placeholder -
low Secrets in code
secret-password-literalscripts/output_guard.py:99Hard-coded password / key literal (may be an example) (placeholder value)"API_KEY=sk-1…def",
placeholder -
low Secrets in code
secret-private-keyscripts/output_guard.py:103Private key material (placeholder value)"-----BEGIN PRIVATE KEY----- …",
placeholder -
low Secrets in code
secret-password-literalscripts/test_guardrails.py:147Hard-coded password / key literal (may be an example) (placeholder value)("API_KEY=sk-1…def", True, "API密钥过滤"),placeholder -
low Secrets in code
secret-high-entropy-tokenscripts/test_guardrails.py:152High-entropy token-like string (may be an id, hash or a credential) (test fixture / example file; quoted — discussed, not commanded)("token = eyJh…CJ9", True, "访问令牌过滤"),fixturequoted -
low Secrets in code
secret-password-literalscripts/test_guardrails.py:215Hard-coded password / key literal (may be an example) (test fixture / example file; quoted — discussed, not commanded)r3 = system.check_output("API_KEY=sk-s…123, email: ad…@….com")fixturequoted
A further 11 matches are quotations in this security skill's documentation and are not counted as findings.
Files scanned: 24. Evidence is masked. Grey chips explain why severity was lowered.
Against the Agent Skills spec
- warning
description-no-whendescription does not say WHEN to use the skill (no "use when") - note
frontmatter-keyunknown frontmatter key "triggers"
Process rating: all ten parameters 50/100
- 0Result and completion. Does not say what the result is
- 0Inputs and preconditions. Does not say what the process needs to start
- 20When it triggers. No condition that starts the skill
- 30Running it twice. 3 mutating operations with no state check
- 50Failures and branches. 0 branches, has a failure section
- 60Tools and files. Uses tools (python) that frontmatter does not declare
- 100Steps. 17 steps
- 100Consistency. Name and required fields are in place
- 100Execution cost. Instruction body is 3050 tokens
- 100Progress reporting. Reports progress
Everything here is measured from the skill text rather than judged by a model, so the numbers are checkable. A parameter weighs more when it is a more common reason for the process to stall.
Quality signals
- +5Description has no quoted example phrases that should trigger the skill
- +4Description does not say when NOT to use the skill (false activations)
- +3Description length 91: 120–800 characters recommended
- +3Output format is not stated: the model decides each time
- +1No license
- +2Single-language instructions
- +4Structure: 33 headings
- +3Step-by-step instructions: 17 items
- +4Has examples (18 code blocks)
- +4Reference files are cited in the instructions (9 of 9)
- +3All 9 scripts are documented
Quality base 70; lint remarks subtract, signals add up to 100. Result: 75.