This is the instruction file of an agent skill named classifying-key-weaknesses. An AI agent that has the skill installed reads it when asked to triage a key finding. Download the skill as a zip: it contains this file, the criteria, the decision guide, the schema, the examples and a checker script. Unpack it into the agent's skills directory.

Classifying key weaknesses

Turn a description of a key and what is known about it into findings, evidence levels and one disposition, using the Key Weakness Classification (KWC). KWC is a research proposal, not a standard, and is unrelated to CWE; say so when reporting to people who may take the class names as established.

Numerical value, generation probability, guess rank and attack cost are different quantities. "Weak" always needs an objective and an attack model.

Classes

Nonexclusive. Answer every question; never stop at the first match.

Code Name The weakness lies in
A1 Primitive-weak key The keyed transformation (oracle access)
A2 Problem-instance-weak key The public mathematical instance derived from the key
B1 Low-guesswork key A named search strategy and budget
B2 Predictably generated key The process that produced or provisioned the key
C1 Relationally vulnerable key Data from outside the instance: other keys, runs
C2 Compromised key An unauthorized party knows or has had the key
C3 Policy-inadequate key A named policy, version and rule
- Invalid key Fails admissibility rules; outside A1 to C3

Procedure

  1. Name the secret and its role (long-term, ephemeral, nonce, seed, generator-state). If the defect lies in a nonce or seed, write one report for that secret and one for the long-term key, linked.
  2. Work through steps 1 to 8 of references/decision-guide.md for each secret. For each yes, record what the step asks for. A no needs no entry; explain a no that a reader would expect to be a yes in a finding's or the disposition's note.
  3. Record the descriptors that apply (guide step 9): accessibility, lengths, generator fingerprint. They are not classes.
  4. Give each finding an evidence level; give a B2 finding a second level for its cause (guide step 10).
  5. Apply the disposition rules in order; the first match decides (guide step 11).
  6. Write the report in the format of references/report-schema.yaml. Start from the closest file in references/examples/, then recheck every evidence level against your case: the examples' levels come from their own facts. - Put a check that fired in the finding's detection. - Use the top-level scan block for the list of checks run, including those that did not fire. Omit scan and detection.tool when no tool was involved. - sources takes labels from the repository's bibliography, which is not bundled: omit it, and name your own sources in note.
  7. Validate: python3 <skill dir>/scripts/check_report.py report.yaml (needs PyYAML; runs from any directory). It checks the schema and recomputes the disposition from your findings. Fix every line it prints. A pass means the report is well formed and its disposition follows from its findings. It does not check that the classes or evidence levels are justified.
  8. Tell the user: each finding in the notation of classification II.2 with its evidence level, the disposition and the rule that gave it, what is not known (often the cause), and that the classification is a research proposal. Follow the wording rules below.

Read references/classification.md when a step is unclear or a case sits on a boundary. It is the authority; the guide restates it. Where to look: cost and \(\rho\), I.2; group A and \(\kappa\), I.3; B1 and B2, I.4; C1, C2, C3, I.5; invalid keys and descriptors, I.6; evidence levels, II.1; finding notation, II.2; disposition, II.3; tool checks, II.4.

\(\lambda\) is the security level the key's use requires, in bits; lambda_required records it. Take it from the policy in force, or from the construction's nominal level (112 for RSA-2048, 128 for P-256 and Ed25519, 192 for P-384, the key length in bits for a symmetric key).

Where raters go wrong

These come from tests with independent raters and from errors caught in the source material. Check each before finishing.

B1 and B2

Group A and C1

C2 and published values

Evidence levels

Disposition and budgets

Quantities for group A

Report these when a finding is A1 or A2; definitions are in classification I.2 and I.3.

Disposition

Rule Condition Action
0 Invalid reject-invalid
1 C2 at credible or above treat-as-compromised
2 Recovery demonstrated (A, C1, or B1 with recovered: true); or A or C1 at credible or above with recovery, forgery or confidentiality feasible; or group A at credible or above with listing_feasible treat-as-compromised
3 B2 at credible or above (effect or cause) with a \(\lambda\) shortfall treat-as-compromised
4 C3 rule that mandates rejection reject-by-policy
5 Any finding at indicated or above, counting a B2 cause level investigate
6 Otherwise none

"Investigate" asserts no defect. "None" does not certify the key.

Wording rules

Scope

Classify and report. Never recover, factor or brute-force a real key that the user is not authorized to test, and never run this against live systems. Toy and synthetic keys are fine for illustration.

References

scripts/check_report.py is the entry point; it calls scripts/check_reports.py. Everything under references/ and scripts/check_reports.py is generated from the keyweakness repository (https://keyweakness.org) by tools/build_skill.py. Never edit those copies. Pointers inside them to sources/, agent_docs/, experiments/ or 02 §n lead into that repository and are not needed to apply the skill. Where a copy mentions tools/check_reports.py, use scripts/check_report.py here.