Fix a failed check¶
This guide takes you from a failed opencomplai check to a per-article list of what is missing, copy-paste templates for each gap, and a re-run that shows what improved. It is written for the first time you see control_fail and only two control IDs.
You need a system-manifest.json (see init). Every command below was run on 0.17.0 with pip install opencomplai==0.17.0.
Why the first failure looks empty¶
A bare check reports the verdict and the failed control IDs, and nothing else:
{
"system_id": "cv-screen",
"result": "control_fail",
"failed_controls": ["EU_AIA_ART6_HIGH_RISK", "EU_AIA_ART6_PROFILING"],
"scan_summary": null,
"gap_report": null,
...
}
gap_report and scan_summary are null because two things are off by default:
--scan-mode ci | local | airgaponly sets the exit-code policy (inci, a degraded result exits1). It does not run the code scan and it does not add a gap report.--scanruns the code scan.--with-gapsadds the per-article gap report to the artifact.
Nothing is wrong with the CLI or your manifest. Add the two flags.
Step 1: run the full check¶
You should see result: CONTROL_FAIL and a failed_controls: line. The first --scan run also creates an .ocignore file in the repository root (edit it to change what the scanner reads). The exit code is 1.
compliance-artifact.json now carries a gap_report with one row per article. The human output does not print the table; read it in the next step.
Step 2: read the failed controls¶
| Control | What it means | What to do |
|---|---|---|
EU_AIA_ART6_HIGH_RISK | The manifest describes an Annex III high-risk system (for example employment, credit scoring or education), so the high-risk obligations apply. This is a finding about what the system is, not a defect. | Confirm the description is accurate. If it is, work through the gap list below, then record an acceptance. If it is wrong, correct intended_purpose. |
EU_AIA_ART6_PROFILING | The declared purpose describes scoring or evaluating natural persons: profiling vocabulary with a word that names a person (for example candidate, cv screening, recruitment, but also credit scoring of applicants, insurance risk pricing or benefit eligibility), or the assessment answered profiling_detected. Under Art. 6(3) a system that profiles people is always high-risk, so the Art. 6(3) derogation cannot apply. A purpose that scores a company or a portfolio does not fire it. | Same as above. An acceptance does not clear this control, and nothing does in 0.17.0 or 0.18.0 while the purpose describes profiling of people. |
EU_AIA_ART5_UNACCEPTABLE | The purpose matches a prohibited practice (Art. 5). Exit 3, not 1. | Review the declared purpose with your compliance team; see exit codes. |
EU_AIA_ART25_MODIFICATION_TRAP | A --change-context value declared a substantial modification. Exit 4. | See Handle a modification halt. |
EU_AIA_ART6_3_EXEMPTION_RECORD | Only with --require-exemption-record: the manifest relies on the Art. 6(3) derogation and no valid signed exemption record exists. | Write one with accept --exemption. |
Art. 9, Art. 13, ... | After an acceptance, the Missing EU AI Act articles themselves are listed. | Close the gap (steps 3 to 5). |
NIST_AI_RMF:MANAGE 1.3, ... | A framework you gate with --gate or opencomplai.yaml. | See Framework gates. |
To see why a rule failed, including the words in your purpose that matched, print the rule results:
opencomplai risk classify --system-id cv-screen --intended-purpose "CV screening for recruitment, ranks candidates" -o json
Each entry in rule_results has rule_id, passed and a rationale, for example Use case '...' matches Annex III categories: employment. Every code is described in Control codes.
Step 3: list the gaps¶
You get one row per article with a status:
| Status | Meaning |
|---|---|
| Met | The evidence the tool can see supports the article. A heuristic, not a legal finding. Art. 25 reads Met with No substantial modification declared in assessment answers: you declared none, nobody reviewed anything. |
| Partial | Some evidence found, for example a file with some of the expected content. A file that exists is enough, so an empty scaffold already reads Partial; the rationale says still contains N unfilled scaffold placeholder(s). Partial is not progress until the file is filled in. |
| Missing | No evidence found. |
| Unverified | Only an attestation, or a check that did not run, can decide this row. |
To read the rows in the order you would work them (deadline, severity, effort):
gaps prints a six-column table. At the default 80 columns the Evidence and Rationale columns are cut off, so widen the terminal to more than 150 columns first, or set COLUMNS for one run:
For a file a script can read, use opencomplai gaps --output json. The rows are under payload.articles, each with article, status, source, evidence_ref and rationale:
The Mapped column of the table is the ISO/IEC 42001 clause the article corresponds to in the tool's crosswalk: a citation, not a result. gaps never changes an exit code, so it is safe to run anywhere.
Step 4: get templates for each gap¶
Wrote 17 remediation template(s) to fixes
fixes\art6-annex_iii_applicability_note.md
fixes\art9-risk_register_entry.md
fixes\art11-art11_technical_documentation.md
...
Art. 17 QMS per-clause: 0/13 present, 13/13 missing (see the qms_outline.md written above for detail)
Each file in fixes/ is a static template for one Missing or Partial row, with the text _fill in_ where only you know the answer. Nothing is sent anywhere. Use -o <dir> to write somewhere else. See recommend for what each template is.
Step 5: add the evidence, then re-check¶
gaps looks for evidence by file name and content. The file names below are the ones the EU AI Act probes look for, relative to --repo-root (default .). A file only counts when it also holds the marker words in the last column. Edit a template, save it under one of these names, and re-run.
| Article | Save it as (any one) | It must mention |
|---|---|---|
| Art. 9 risk management | risk_register.json, risk-register.json, docs/risk* | a risk-identification word and a mitigation word |
| Art. 11 technical documentation | dossier_<id>.json from docs generate | written by the CLI; never reported Met by this probe |
| Art. 13 instructions for use | docs/instructions*, INSTRUCTIONS.md, DEPLOYER.md | the intended purpose, and one of oversight, misuse, limitation, accuracy, maintenance, contact |
| Art. 14 human oversight | human_oversight*, oversight* or docs/**/oversight* | a file of that name, or a code construct such as require_approval |
| Art. 12 logging | oversight-log.json or agent-log.jsonl | presence of the log |
| Art. 17 quality management | docs/qms/*, QMS.md, QUALITY_MANAGEMENT.md | per clause, see qms |
| Art. 27 fundamental rights impact | docs/fria*, FRIA.md | see fria |
| Art. 72 post-market monitoring | docs/post-market-monitoring-plan*, POST_MARKET_MONITORING_PLAN.md | post-market or monitor |
| Art. 73 serious incidents | incident-log.json | see incident |
These are file-name conventions and keyword checks. A file that passes them raises the row to Partial or Met in the report; it is not a legal assessment of the content. The other articles are decided by the scan, by evaluators (--sample-set) or by attestations.
Re-run, and compare with the earlier artifact:
Changed verdicts
Art. 13 missing partial better
Art. 9 missing partial better
Unchanged: 22
Step 6: record the classification, if it is correct¶
If the system really is high-risk, EU_AIA_ART6_HIGH_RISK will keep failing. A signed acceptance record acknowledges the classification so the remaining rows can decide the result:
accept signs with the key from opencomplai init, writes a record under .opencomplai/acceptances/ and tells you to commit it. After the commit, EU_AIA_ART6_HIGH_RISK leaves failed_controls.
An acceptance does not say the system is compliant. It clears only EU_AIA_ART6_HIGH_RISK: EU_AIA_ART6_PROFILING and every Missing article stay in failed_controls, and the check still exits 1 until the Missing rows are closed. For recruitment, credit and other profiling systems exit 1 is the permanent baseline; see Exit code 1 stays after accept for how to set CI policy. An edit to the manifest after you sign makes the record stale, and it stops counting. The full matrix is in Exit codes.
Put it in CI¶
Use the same flags in CI. With the GitHub Action:
On a high-risk system this exits 1 until every gap is closed, and EU_AIA_ART6_PROFILING never clears in 0.17.0 and 0.18.0, so while you close gaps you can add fail-on-error: "false" to report without failing the job.
With the plain CLI in any CI:
See CI integration for what each flag does.
Where to go next¶
- Share evidence with an auditor to sign, verify and export the result.
- Control codes for every failed-control ID.
- My check failed but shows no details if you arrived from an artifact with null fields.