/appsec-workflow:create-rulefrom OpenTaint AppSec Workflow
Authors and verifies OpenTaint taint-analysis rules for sources and sinks, checking existing coverage and validating against test projects.
Ships in OpenTaint AppSec Workflow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
OpenTaint is a whole-program, interprocedural, field-sensitive alias analysis engine. It already propagates through visible application code, calls, aliases, and individual fields; custom rules and models cover only the assigned source, sink, or opaque-method boundary. Compile-time constants and literals carry no taint, so a source or carrier whose output is only a constant introduces nothing.
A unit names the source or sink members to detect. Identify an existing built-in or project library rule when it already implements the boundary, otherwise author a custom rule, then verify the unit against its test project. Every selected or created source rule must carry the unit's untrusted-data-source tag, and every selected or created sink rule must carry its unit group's *-sink tag. Production joins use those tags and are assembled later only when a new sink tag needs one.
Provided by the caller, fall back to the default value when omitted. Ask back only when a required input is missing and has no sensible default
project-root (optional) — root of the target project. Opentaint keeps all analysis artifacts under the fixed <project-root>/.opentaint/ directory, so every .opentaint/... path below resolves there. Default: current directorylanguage (required) — target language for this project and language-specific instructionsside (required) — sources or sinks; the unit's side. It selects the unit file, the sample style, and the test sub-projectunit (required) — the <package-kebab> identifying the unit. Its spec and tracking are in .opentaint/tracking/rules/<side>/<unit>.yaml; its test project is .opentaint/test-projects/<unit>/<side> and its compiled model .opentaint/test-compiled/<unit>/<side>fix-target (optional) — a created rule <path>#<id> the main scan flagged, plus the false positive or false negative to correct. When set, narrow or broaden that one rule instead of authoring from the unitBrowse the built-in library rules and .opentaint/rules to determine whether one already matches each unit entry. When one does, do not author a duplicate: set its rule_id in .opentaint/tracking/rules/<side>/<unit>.yaml to <relative-yaml-path>#<rule-id>. This string is tracking bookkeeping only. Do not add a rule reference to any production rule, production joins remain tag-based and are written later. The following command prints the built-in rules root path. Browse both roots using the language reference and search by the entry's exact language-specific identifier:
opentaint health --rules
Read .opentaint/tracking/rules/tags.yaml. A source unit must carry tag: untrusted-data-source, each sink unit group carries the one existing or newly registered *-sink tag its rules must extend.
In fix mode, don't author from the unit: go straight to that one flagged rule, adjust it by the false-positive/negative guidance per step 4, re-run this side's tests, and stop — leave the unit's other entries untouched. Otherwise, when entries already carry rule_id, continue from those recorded implementations and author only entries still lacking coverage. When the unit is partway (some stages done, some not), continue from the first unfinished stage on the artifacts already on disk rather than restarting.
Derive each rule's pattern from the unit's exact member identifiers, recorded signatures, and relevant declaration metadata. Bind the tainted value to $UNTRUSTED and put the unit/group tag on the lib rule. A sink tag belongs to the whole semantic group, not to an individual method. One rule can cover several group methods and several rules can carry the same tag. The rule forms and locations are in the language reference.
For side: sinks, iterate groups: ensure every method under groups[].sinks has an implementing rule_id, and put the enclosing groups[].tag on every custom rule you create. For side: sources, use the unit's top-level tag.
A library rule emits nothing on its own — to exercise it, wire it to the generic taint marker in a throwaway test join. Write one join for the side into the test project's marker rules, referencing the generic marker on one end and each lib rule_id selected for the unit on the other, so a positive sample's tainted value flows marker-to-rule (a sink side) or rule-to-marker (a source side). The test joins live only in the test project, never in the scanned rules tree. Their form, naming, and location are in the language reference.
Run the rule tests directly as a foreground, blocking command and wait for exit — never background them or use Monitor. Load your lib rules and the test joins + markers, and iterate until every sample passes:
opentaint test rule run .opentaint/test-compiled/<unit>/<side> \
-o .opentaint/test-results/<unit>/<side> \
--ruleset .opentaint/rules --ruleset .opentaint/test-projects/<unit>/<side>/test-rules \
--passthrough-models .opentaint/pass-through
test rule run auto-loads the built-in rules, so pass only your custom rulesets. Apply the passthrough models as-is, an empty one is harmless. Read the result with the bundled script — it prints the pass/fail counts and names the failing samples, so you never parse the JSON by hand:
uv run <skill-dir>/scripts/check-test-result.py <unit>/<side>
Fix by the verdict it reports:
falseNegative → the match is too narrow, broaden it and confirm the metavariable names line up across branches and between refs and onfalsePositive → the match is too broad, add an exclusion or a sanitizerskipped / disabled → the rule wasn't exercised; fix the sample's rule-test.yaml entrypoint or rule-id, or enable the ruleThe concrete pattern operators for each fix are in the language reference.
A positive that won't pass after ~3 rule fixes may have a cause no rule edit can fix. Localize the cause per references/debugging.md, then leave stages.tests_passing: pending and report it (per Output), rather than editing blindly.
.opentaint/rules.opentaint/tracking/rules/<side>/<unit>.yaml — the unit's entries updated (per Tracking)test rule run command usedstages.tests_passing left pending, and the cause —
This skill writes each unit entry's implementing rule_id and the unit's stages.tests_passing. rule_id is a <relative-yaml-path>#<id> locator for either the custom lib rule created for that entry or an existing built-in lib rule proven to cover it. Preserve the source unit's top-level tag and every sink groups[].tag, those tags are the authoring contract. A blocked unit stays tests_passing: pending.
.opentaint/tracking/rules/sources/<package-kebab>.yaml — one source unit per package (a dependency can span several packages), the file named for that package with . → -. tag is always the reusable untrusted-data-source group. dependencies names the dependency the package comes from, sources each an entry point { method, signature, note, rule_id } (method and signature use the exact language-specific identifiers from the plan), stages tracks the unit through rule authoring, and a blocker string is added under it when the unit can't be made to pass. Keep it clear from comments
dependencies:
- <dependency-id>
tag: untrusted-data-source
sources:
- { method: "<qualified-member>", signature: "<language-signature>", note: untrusted message payload, rule_id: null }
stages:
test_project: pending
tests_passing: pending
.opentaint/tracking/rules/sinks/<package-kebab>.yaml — one sink unit per package (a dependency can span several packages, each its own unit), the file named for that package with . → -. dependencies names the dependency the package comes from. groups partitions the package's dangerous operations by reusable sink tag; each group is { tag, sinks }, and each sink is { method, signature, note, rule_id }. The tag belongs to the group, never to an individual method: one rule may cover several methods and several rules may extend the same vulnerability family. method and signature use the exact language-specific identifiers from the plan. stages tracks the unit through rule authoring. Keep it clear from comments
dependencies:
- <dependency-id>
groups:
- tag: path-traversal-sink
sinks:
- { method: "<qualified-member>", signature: "<language-signature>", note: writes data to an untrusted path, rule_id: null }
stages:
test_project: pending
tests_passing: pending
options.lib: true and severity: NOTEuntrusted-data-source tag, created sink rules MUST carry their enclosing sink group's registered *-sink tagmetadata.cwe and metadata.short-descriptionrefs and on clauses or the join won't connect. Bind the tainted value to $UNTRUSTED in every lib source/sink rulerule paths are relative to a ruleset root: marker rules resolve under the test project's rules, lib rules under the built-in or custom scanned rules treeWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
taint-analysis, static-analysis, security-rules, opentaint, source-sink
npx claudepluginhub seqra/opentaint --plugin appsec-workflow16 skills in this plugin
/analyze-external-methodsAnalyze an OpenTaint scan's dropped external methods and decide which of them are propagators and optionally sinks. Use when a dropped-external-methods.yaml needs classification for dropped method type/analyze-findingsTriage OpenTaint findings statically. Use when scan findings need a TP/FP verdict/appsec-agentRun an end-to-end OpenTaint application-security analysis while owning the long project build and scans and delegating each other pipeline stage. Use when the user asks to find vulnerabilities, or scan an application for security issues/assemble-lib-rulesConnect the shared untrusted-data source group to new reusable OpenTaint sink groups. Use to wire new sink tags into security joins/build-projectBuild a target project into an opentaint project model. Use whenever a fresh opentaint project model needed/create-dataflow-modelModel a method's taint propagation as code-based dataflow model and refine it against a test project until the sample passes. Use for a dropped method that requires code-based modelOther plugins' skills for the same job