Checking Model Compliance
Runs Model Advisor checks for a named standard (or default configuration) and delivers a prioritized summary with fix suggestions.
When to Use
- Checking whether a Simulink model complies with a standard (MISRA, MAB, JMAAB, ISO 26262, DO-178C, etc.)
- Running Model Advisor checks against a named compliance standard
- Generating a compliance report with prioritized findings and fix suggestions
- Running a custom Model Advisor configuration file against a model
- Justifying or waiving specific compliance violations
When NOT to Use
- Building or editing model structure →
building-simulink-models
- Writing behavioral tests →
testing-simulink-models
- Structural validation only (unconnected ports) →
model_check tool directly
- General model quality questions without a named standard (e.g., "is my model well decomposed?") — this requires a different workflow
Supported Standards
| Standard |
Accepted Inputs |
| MISRA C:2023 |
MISRA_C, MISRA C, MISRA |
| MISRA Simulink/Stateflow |
MISRA_SLSF, MISRA Simulink |
| MAB |
MAB, MAAB |
| JMAAB v5.1 |
JMAAB |
| JMAAB v6 |
JMAAB_V6, JMAAB06 |
| ISO 26262 |
ISO_26262, ISO 26262 |
| ISO 25119 |
ISO_25119, ISO 25119 |
| DO-178C/DO-331 |
DO_178C, DO-178C, DO-178B, DO-331 |
| DO-254 |
DO_254, DO-254 |
| IEC 61508 |
IEC_61508, IEC 61508 |
| IEC 62304 |
IEC_62304, IEC 62304 |
| EN 50128/EN 50657 |
EN_50128, EN 50128, EN_50657 |
| Secure Coding (CERT C, CWE) |
SECURITY, CERT_C, CWE, secure coding |
| AUTOSAR |
AUTOSAR |
| Simulink Code Inspector (SLCI) |
SLCI, Simulink Code Inspector |
Equivalent check sets (run once, report for both):
- ISO 26262, IEC 61508, IEC 62304, EN 50128/EN 50657, ISO 25119
- DO-178B, DO-178C, DO-331
Custom Checks and Configurations
Users may have custom Model Advisor checks or custom configuration files (.json exported from Model Advisor Configuration Editor). These are not standards — they are handled via:
- Custom configuration file: User provides a path → use
model_advisor_run with 'configuration' parameter directly (Path B)
- Custom check IDs: User provides specific check IDs → use
model_advisor_run with 'checks' parameter directly (skip resolution)
Prerequisites
All script functions are in the skill's scripts/ directory. Use evaluate_matlab_code with project_path set to the skill's scripts/ folder so MATLAB can find them. Never use addpath.
Tools provided (always use these — never improvise with raw Model Advisor API):
| Function |
Inputs |
Output |
Example |
model_advisor_resolve_checks |
'standard', '<NAME>' |
struct with checks, checks_count, status |
model_advisor_resolve_checks('standard', 'JMAAB') |
model_advisor_run |
system, 'checks', {ids} or system, 'configuration', path |
YAML with findings, status, check_summary |
model_advisor_run('MyModel', 'checks', checkIds, 'token_budget', 8000) |
model_advisor_justify |
model, checkId, blockPath, text |
struct with status |
model_advisor_justify('MyModel', 'mathworks.jmaab.db_0032', 'MyModel/Sub', 'Waived per review') |
detect_default_config |
modelName |
struct with config_path or empty |
detect_default_config('MyModel') |
Workflow
1. Identify Standard, Model, and Scope
Determine from user request:
- Standard — map to supported name (see table). Defaults: "MISRA" →
MISRA_C. For "JMAAB" without version → ask user (v5.1 or v6)
- Model —
.slx file (ask if ambiguous)
- Scope — full model (default) or subsystem path (e.g.,
Model/Controller)
Disambiguation rules:
- "JMAAB" without version specifier → ask (v5.1 or v6 — two distinct check sets)
- "ISO" without specifier → ask (multiple supported)
- "DO" without specifier → ask (178C vs 254)
- Multiple standards requested → resolve each, compare sets, run once if identical
2. Choose Path
Path A — Standard named: Proceed to step 3.
Path B — No standard, user says "run Model Advisor" / "check my model":
Run detect_default_config(modelName). If config found → skip to step 4. If empty → ask which standard (show supported list).
3. Resolve Checks (Path A only)
model_advisor_resolve_checks('standard', '<STANDARD_NAME>')
status: success → note checks_count, inform user
status: truncated → use returned config file path in step 4
status: error → report and stop
Gate: If checks_count > 100, confirm with user before proceeding.
Shortcut: If the user already has specific check IDs, call model_advisor_run directly with those IDs and skip to step 5.
4. Run Checks
model_advisor_run('<system>', 'checks', {<check_ids>}) % inline checks
model_advisor_run('<system>', 'configuration', '<config_path>') % config file
Use 'token_budget', 8000. If truncated, read full results from full_results path.
5. Analyze Findings
Classify from YAML response:
- Critical (Failed) — must fix for compliance
- Warnings (Warning) — should fix, may be justifiable
- Informational — low priority
6. Present Compliance Report
For non-MAB/JMAAB standards, use this template:
## Compliance Summary: <Standard>
Model: <model> [Scope: <subsystem> if scoped]
Result: X passed, Y warnings, Z failures
### Critical Findings (must fix)
| Check | Blocks | Fix Type | Action |
|-------|--------|----------|--------|
| name | N | param/insert/config/routing/arch | what to change |
### Warnings (should fix)
| Check | Blocks | Fix Type | Action |
|-------|--------|----------|--------|
### Passed
N checks passed.
### Suggested Next Steps
[5-7 prioritized actions max]
For MAB, JMAAB, or JMAAB_V6 standards, use this template instead (includes the uncheckable guidelines review as an integral part of the report):
## Compliance Summary: <Standard>
Model: <model> [Scope: <subsystem> if scoped]
Result: X passed, Y warnings, Z failures
### Critical Findings (must fix)
| Check | Blocks | Fix Type | Action |
|-------|--------|----------|--------|
| name | N | param/insert/config/routing/arch | what to change |
### Warnings (should fix)
| Check | Blocks | Fix Type | Action |
|-------|--------|----------|--------|
### Passed
N checks passed.
---
### Agentic Review of Uncheckable Guidelines (LLM-based — not deterministic)
> **Note:** This is a semantic evaluation performed by an AI agent, not a deterministic Model Advisor check.
**Model:** <model_name>
**Judgment:** PASS | WARNING | FAIL
**Confidence:** 0.XX
#### Critical (must fix)
| Guideline | Blocks | Fix Type | Action | Confidence |
|-----------|--------|----------|--------|------------|
#### Warnings (should fix)
| Guideline | Blocks | Fix Type | Action | Confidence |
|-----------|--------|----------|--------|------------|
### Evidence
[2-3 sentences citing specific model data]
### Recommendation
[Top 3-5 prioritized actions, or "No action required."]
---
### Suggested Next Steps
[5-7 prioritized actions max, combining both deterministic and uncheckable findings]
Fix Type values: param (block parameter), insert (add block), config (model config), routing (reconnect signals), arch (restructure — recommend only)
Conciseness rules:
- One line per check; max 3-5 block paths shown per check (state total)
- Target 40-60 lines; max ~80
- Offer "I can list all affected blocks for check X" for detail
7. Performing the Uncheckable Guidelines Review (JMAAB/MAB only)
This section explains HOW to fill in the "Agentic Review of Uncheckable Guidelines" section that is part of the MAB/JMAAB report template above. You MUST complete this before presenting the report to the user.
Skip this step ONLY for other standards (MISRA, ISO 26262, DO-178C, etc.).
For JMAAB, JMAAB_V6, or MAB standards → load and follow references/uncheckable-guidelines-review.md.
What to do: Evaluate guidelines that Model Advisor cannot fully verify — guidelines where semantic judgment is required or no check exists at all. Load references/semantic-evaluation-index.md to get the list of uncheckable guidelines, then:
- From the Model Advisor results, identify which checked guidelines appear in the semantic evaluation index
- For those guidelines, extract model data using MCP tools (
model_overview, model_read, model_query_params)
- Apply the Quick Rules from the index for each applicable guideline
- For borderline cases, use the Semantic Gap column to calibrate judgment
Judgment: worst verdict across findings (FAIL > WARNING > PASS). Confidence 0.0-1.0. Do NOT issue FAIL if confidence < 0.5.
8. Fix Mode
Ask: "Would you like me to fix these issues?"
- No → stop (report only)
- Yes → load and follow
references/fix-mode.md workflow
9. Justification Mode
If user wants to justify/waive/suppress violations → load and follow the Justification section in references/fix-mode.md.
Guardrails
Always
- For JMAAB/JMAAB_V6/MAB: ALWAYS perform Step 7 (Uncheckable Guidelines Review) — the report is incomplete without it
- Show standard name + check count before running
- Include block paths in findings
- Follow Fix Order strictly (structural → diagnostic) to prevent cascading false failures
- Summarize, do not echo raw output
- Confirm with user before executing >=100 checks
- Ask the user for justification text before adding any justification — never fabricate rationale
- If a reference tool returns an error, report it verbatim — do not retry with alternative approaches
- Confirm which model to check if multiple
.slx files are present or the name is ambiguous
- State the resolved standard name and version in the report header
- Report the exact check count from tool output
- When explaining failures, list all distinct root causes
Ask First
- Fix mode modifications — never modify model without per-batch confirmation
- Justification — always a human decision
- Running >100 checks — confirm scope is intentional
Never
- Claim "model IS compliant" — only report pass/fail; compliance determination is user's responsibility
- Escalate diagnostics before structural fixes
- Suppress findings without explicit request
- Guess parameter names — use exact
parameter field from check output
- Modify the MATLAB path permanently (no
savepath)
- Run
slbuild or code generation without explicit user permission
- Re-run checks unnecessarily — reuse violation IDs from the most recent run if the model has not been modified since; only re-run to get fresh hashes if the model changed
Error Recovery
| Error |
Action |
UNKNOWN_STANDARD |
Check for typo/alias (e.g., "MAAB" → MAB). If valid but unsupported standard, acknowledge and show supported list. |
LICENSE_FAILED |
Simulink Check license required |
MODEL_NOT_FOUND |
Ask for correct model path |
CHECK_NOT_FOUND |
Release mismatch — tell user which MATLAB release needed |
CONFIG_NOT_FOUND |
Stale path — ask for update or fall back to named standard |
EXECUTION_FAILED |
Model may have compilation errors — suggest fixing first |
| Token budget exceeded |
Read full results from full_results field |
HASH_NOT_FOUND (justify) |
Model modified since last run — re-run checks for fresh ids |
JUSTIFICATION_FILE_ERROR |
Check file permissions and license |
Copyright 2026 The MathWorks, Inc.
1---2name: checking-model-compliance3description: Use this skill when the user asks to check Simulink model compliance against a standard (MISRA, MAB, JMAAB, ISO, DO, IEC, EN, CERT C/CWE, AUTOSAR, Simulink Code Inspector (SLCI)), wants to run Model Advisor checks, or needs a compliance report with fix suggestions. For JMAAB/MAB, supplement deterministic checks with agentic review of uncheckable guidelines.4license: https://www.mathworks.com/content/dam/mathworks/license/pmrl/lic5---6
7# Checking Model Compliance
8
9Runs Model Advisor checks for a named standard (or default configuration) and delivers a prioritized summary with fix suggestions.
10
11## When to Use
12
13- Checking whether a Simulink model complies with a standard (MISRA, MAB, JMAAB, ISO 26262, DO-178C, etc.)
14- Running Model Advisor checks against a named compliance standard
15- Generating a compliance report with prioritized findings and fix suggestions
16- Running a custom Model Advisor configuration file against a model
17- Justifying or waiving specific compliance violations
18
19## When NOT to Use
20
21- **Building or editing model structure** → `building-simulink-models`
22- **Writing behavioral tests** → `testing-simulink-models`
23- **Structural validation only (unconnected ports)** → `model_check` tool directly
24- **General model quality questions** without a named standard (e.g., "is my model well decomposed?") — this requires a different workflow
25
26## Supported Standards
27
28| Standard | Accepted Inputs |
29|----------|----------------|
30| MISRA C:2023 | `MISRA_C`, `MISRA C`, `MISRA` |
31| MISRA Simulink/Stateflow | `MISRA_SLSF`, `MISRA Simulink` |
32| MAB | `MAB`, `MAAB` |
33| JMAAB v5.1 | `JMAAB` |
34| JMAAB v6 | `JMAAB_V6`, `JMAAB06` |
35| ISO 26262 | `ISO_26262`, `ISO 26262` |
36| ISO 25119 | `ISO_25119`, `ISO 25119` |
37| DO-178C/DO-331 | `DO_178C`, `DO-178C`, `DO-178B`, `DO-331` |
38| DO-254 | `DO_254`, `DO-254` |
39| IEC 61508 | `IEC_61508`, `IEC 61508` |
40| IEC 62304 | `IEC_62304`, `IEC 62304` |
41| EN 50128/EN 50657 | `EN_50128`, `EN 50128`, `EN_50657` |
42| Secure Coding (CERT C, CWE) | `SECURITY`, `CERT_C`, `CWE`, `secure coding` |
43| AUTOSAR | `AUTOSAR` |
44| Simulink Code Inspector (SLCI) | `SLCI`, `Simulink Code Inspector` |
45
46**Equivalent check sets (run once, report for both):**
47- ISO 26262, IEC 61508, IEC 62304, EN 50128/EN 50657, ISO 25119
48- DO-178B, DO-178C, DO-331
49
50### Custom Checks and Configurations
51
52Users may have custom Model Advisor checks or custom configuration files (`.json` exported from Model Advisor Configuration Editor). These are not standards — they are handled via:
53- **Custom configuration file:** User provides a path → use `model_advisor_run` with `'configuration'` parameter directly (Path B)
54- **Custom check IDs:** User provides specific check IDs → use `model_advisor_run` with `'checks'` parameter directly (skip resolution)
55
56## Prerequisites
57
58All script functions are in the skill's `scripts/` directory. Use `evaluate_matlab_code` with `project_path` set to the skill's `scripts/` folder so MATLAB can find them. Never use `addpath`.
59
60**Tools provided** (always use these — never improvise with raw Model Advisor API):
61
62| Function | Inputs | Output | Example |
63|----------|--------|--------|---------|
64| `model_advisor_resolve_checks` | `'standard', '<NAME>'` | struct with `checks`, `checks_count`, `status` | `model_advisor_resolve_checks('standard', 'JMAAB')` |
65| `model_advisor_run` | `system, 'checks', {ids}` or `system, 'configuration', path` | YAML with `findings`, `status`, `check_summary` | `model_advisor_run('MyModel', 'checks', checkIds, 'token_budget', 8000)` |
66| `model_advisor_justify` | `model, checkId, blockPath, text` | struct with status | `model_advisor_justify('MyModel', 'mathworks.jmaab.db_0032', 'MyModel/Sub', 'Waived per review')` |
67| `detect_default_config` | `modelName` | struct with `config_path` or empty | `detect_default_config('MyModel')` |
68
69## Workflow
70
71### 1. Identify Standard, Model, and Scope
72
73Determine from user request:
74- **Standard** — map to supported name (see table). Defaults: "MISRA" → `MISRA_C`. For "JMAAB" without version → ask user (v5.1 or v6)
75- **Model** — `.slx` file (ask if ambiguous)
76- **Scope** — full model (default) or subsystem path (e.g., `Model/Controller`)
77
78Disambiguation rules:
79- "JMAAB" without version specifier → ask (v5.1 or v6 — two distinct check sets)
80- "ISO" without specifier → ask (multiple supported)
81- "DO" without specifier → ask (178C vs 254)
82- Multiple standards requested → resolve each, compare sets, run once if identical
83
84### 2. Choose Path
85
86**Path A — Standard named:** Proceed to step 3.
87
88**Path B — No standard, user says "run Model Advisor" / "check my model":**
89Run `detect_default_config(modelName)`. If config found → skip to step 4. If empty → ask which standard (show supported list).
90
91### 3. Resolve Checks (Path A only)
92
93```matlab
94model_advisor_resolve_checks('standard', '<STANDARD_NAME>')
95```
96
97- `status: success` → note `checks_count`, inform user
98- `status: truncated` → use returned config file path in step 4
99- `status: error` → report and stop
100
101**Gate:** If `checks_count` > 100, confirm with user before proceeding.
102
103**Shortcut:** If the user already has specific check IDs, call `model_advisor_run` directly with those IDs and skip to step 5.
104
105### 4. Run Checks
106
107```matlab
108model_advisor_run('<system>', 'checks', {<check_ids>}) % inline checks
109model_advisor_run('<system>', 'configuration', '<config_path>') % config file
110```
111
112Use `'token_budget', 8000`. If truncated, read full results from `full_results` path.
113
114### 5. Analyze Findings
115
116Classify from YAML response:
1171. **Critical** (Failed) — must fix for compliance
1182. **Warnings** (Warning) — should fix, may be justifiable
1193. **Informational** — low priority
120
121### 6. Present Compliance Report
122
123For **non-MAB/JMAAB standards**, use this template:
124
125```
126## Compliance Summary: <Standard>
127Model: <model> [Scope: <subsystem> if scoped]
128Result: X passed, Y warnings, Z failures
129
130### Critical Findings (must fix)
131| Check | Blocks | Fix Type | Action |
132|-------|--------|----------|--------|
133| name | N | param/insert/config/routing/arch | what to change |
134
135### Warnings (should fix)
136| Check | Blocks | Fix Type | Action |
137|-------|--------|----------|--------|
138
139### Passed
140N checks passed.
141
142### Suggested Next Steps
143[5-7 prioritized actions max]
144```
145
146For **MAB, JMAAB, or JMAAB_V6 standards**, use this template instead (includes the uncheckable guidelines review as an integral part of the report):
147
148```
149## Compliance Summary: <Standard>
150Model: <model> [Scope: <subsystem> if scoped]
151Result: X passed, Y warnings, Z failures
152
153### Critical Findings (must fix)
154| Check | Blocks | Fix Type | Action |
155|-------|--------|----------|--------|
156| name | N | param/insert/config/routing/arch | what to change |
157
158### Warnings (should fix)
159| Check | Blocks | Fix Type | Action |
160|-------|--------|----------|--------|
161
162### Passed
163N checks passed.
164
165---
166
167### Agentic Review of Uncheckable Guidelines (LLM-based — not deterministic)
168
169> **Note:** This is a semantic evaluation performed by an AI agent, not a deterministic Model Advisor check.
170
171**Model:** <model_name>
172**Judgment:** PASS | WARNING | FAIL
173**Confidence:** 0.XX
174
175#### Critical (must fix)
176| Guideline | Blocks | Fix Type | Action | Confidence |
177|-----------|--------|----------|--------|------------|
178
179#### Warnings (should fix)
180| Guideline | Blocks | Fix Type | Action | Confidence |
181|-----------|--------|----------|--------|------------|
182
183### Evidence
184[2-3 sentences citing specific model data]
185
186### Recommendation
187[Top 3-5 prioritized actions, or "No action required."]
188
189---
190
191### Suggested Next Steps
192[5-7 prioritized actions max, combining both deterministic and uncheckable findings]
193```
194
195**Fix Type values:** `param` (block parameter), `insert` (add block), `config` (model config), `routing` (reconnect signals), `arch` (restructure — recommend only)
196
197**Conciseness rules:**
198- One line per check; max 3-5 block paths shown per check (state total)
199- Target 40-60 lines; max ~80
200- Offer "I can list all affected blocks for check X" for detail
201
202### 7. Performing the Uncheckable Guidelines Review (JMAAB/MAB only)
203
204This section explains HOW to fill in the "Agentic Review of Uncheckable Guidelines" section that is part of the MAB/JMAAB report template above. **You MUST complete this before presenting the report to the user.**
205
206Skip this step ONLY for other standards (MISRA, ISO 26262, DO-178C, etc.).
207For JMAAB, JMAAB_V6, or MAB standards → load and follow `references/uncheckable-guidelines-review.md`.
208
209**What to do:** Evaluate guidelines that Model Advisor cannot fully verify — guidelines where semantic judgment is required or no check exists at all. Load `references/semantic-evaluation-index.md` to get the list of uncheckable guidelines, then:
210
2111. From the Model Advisor results, identify which checked guidelines appear in the semantic evaluation index
2122. For those guidelines, extract model data using MCP tools (`model_overview`, `model_read`, `model_query_params`)
2133. Apply the Quick Rules from the index for each applicable guideline
2144. For borderline cases, use the Semantic Gap column to calibrate judgment
215
216**Judgment:** worst verdict across findings (FAIL > WARNING > PASS). Confidence 0.0-1.0. Do NOT issue FAIL if confidence < 0.5.
217
218### 8. Fix Mode
219
220Ask: "Would you like me to fix these issues?"
221- No → stop (report only)
222- Yes → load and follow `references/fix-mode.md` workflow
223
224### 9. Justification Mode
225
226If user wants to justify/waive/suppress violations → load and follow the Justification section in `references/fix-mode.md`.
227
228## Guardrails
229
230### Always
231- For JMAAB/JMAAB_V6/MAB: ALWAYS perform Step 7 (Uncheckable Guidelines Review) — the report is incomplete without it
232- Show standard name + check count before running
233- Include block paths in findings
234- Follow Fix Order strictly (structural → diagnostic) to prevent cascading false failures
235- Summarize, do not echo raw output
236- Confirm with user before executing >=100 checks
237- Ask the user for justification text before adding any justification — never fabricate rationale
238- If a reference tool returns an error, report it verbatim — do not retry with alternative approaches
239- Confirm which model to check if multiple `.slx` files are present or the name is ambiguous
240- State the resolved standard name and version in the report header
241- Report the exact check count from tool output
242- When explaining failures, list all distinct root causes
243
244### Ask First
245- Fix mode modifications — never modify model without per-batch confirmation
246- Justification — always a human decision
247- Running >100 checks — confirm scope is intentional
248
249### Never
250- Claim "model IS compliant" — only report pass/fail; compliance determination is user's responsibility
251- Escalate diagnostics before structural fixes
252- Suppress findings without explicit request
253- Guess parameter names — use exact `parameter` field from check output
254- Modify the MATLAB path permanently (no `savepath`)
255- Run `slbuild` or code generation without explicit user permission
256- Re-run checks unnecessarily — reuse violation IDs from the most recent run if the model has not been modified since; only re-run to get fresh hashes if the model changed
257
258## Error Recovery
259
260| Error | Action |
261|-------|--------|
262| `UNKNOWN_STANDARD` | Check for typo/alias (e.g., "MAAB" → MAB). If valid but unsupported standard, acknowledge and show supported list. |
263| `LICENSE_FAILED` | Simulink Check license required |
264| `MODEL_NOT_FOUND` | Ask for correct model path |
265| `CHECK_NOT_FOUND` | Release mismatch — tell user which MATLAB release needed |
266| `CONFIG_NOT_FOUND` | Stale path — ask for update or fall back to named standard |
267| `EXECUTION_FAILED` | Model may have compilation errors — suggest fixing first |
268| Token budget exceeded | Read full results from `full_results` field |
269| `HASH_NOT_FOUND` (justify) | Model modified since last run — re-run checks for fresh ids |
270| `JUSTIFICATION_FILE_ERROR` | Check file permissions and license |
271
272----
273
274Copyright 2026 The MathWorks, Inc.
275
276----