diagnose rule
Debug and audit Agent Rules policy judgments, violations, and enforcement outcomes using session journals.
Free
Works with the AI Agents you already use
diagnose rule
Example session with this skill installed
Why did rule 'no-leak-pii' fail to trigger a correction in session 8f2b1? It looks like there was a violation in the records.
- Read your context and instructions
- Compiled the diagnose rule
I have analyzed the session journals for session 8f2b1 regarding rule no-leak-pii. The investigation shows that while a violation was recorded, the agent did not issue a correction notice due to the active operating mode.
Rule Diagnosis: no-leak-pii (Session 8f2b1)
| Metric | Value | Notes |
|---|---|---|
| Status | violation | The classifier positively identified a policy breach. |
| Mode | observe | The rule is currently set to monitor-only. |
| Diagnostic | ok | No service failures or size limits were encountered. |
| Outcome | no_action | Correction suppressed by observe-mode configuration. |
| Policy Hash | 7a2c91... | Matches the current version of the PII policy. |
| Episode | 3 | Finding occurred during the third turn of the session. |
| Timestamp | 2023-10-24T14:22:01Z | Evidence found in the response buffer at offset 412. |
The records indicate that the classifier correctly flagged the presence of an email address pattern. However, because the project configuration has this rule set to observe rather than repair, no continue_turn request was generated. The system performed as configured, logging the event without interrupting the agent flow.
Next steps
- Switch the rule to
repairmode inagent-rules.config.jsonif you want active enforcement. - Run
statusto verify the mode change has been picked up by the plugin. - Check episode 4 records to see if the agent continued to output the flagged pattern.
Connects securely to your tools. The creator never sees your data.
About this skill
Rule evaluation and agent behavior can be opaque when a policy triggers or silently fails. This skill provides a systematic way to debug Agent Rules by analyzing session journals, judgment records, and outcome states to explain exactly why a policy behaved the way it did.
What it does
- State analysis identifies effective modes and configuration diagnostics from the state directory.
- Evidence correlation matches specific timestamps and episodes to findings to ensure data accuracy.
- Status decoding translates internal states like
unknown,unavailable, andclearinto actionable insights. - Outcome verification determines if a violation resulted in a correction, a deduplication event, or a retry limit hit.
- Diagnostic filtering separates missing evidence or service failures from actual policy abstentions.
How it works
- Run the
statuscommand to pull the current configuration and state directory path. - Execute
inspect <rule-id>to load current findings and historical record data. - Use the
--session <session-id>flag to isolate the specific host interaction in question. - Analyze the session JSON journals to trace the policy hash, raw judgment, and final outcome.
Frameworks & tools
This tool interfaces with the agent-rules.js plugin and requires access to session JSON journal files and the project's state directory.
Why this beats prompting it yourself
Manual inspection of session journals is error-prone and requires deep knowledge of rule status codes. This skill automatically correlates timestamps and episodes, preventing you from misinterpreting old cached findings or observe-mode violations as failed repairs.
Use cases
- Debug why a repair-mode violation failed to trigger a corrective notice.
- Investigate why a specific rule abstained from judging a suspect response.
- Audit historical policy outcomes across different session IDs.
- Verify if a rule failure was caused by service limits or missing evidence.
Known limitations
Cannot recover original verdicts via live replay. Evidence is limited to retained records; expired or erased episodes cannot be analyzed.
Cannot recover original verdicts via live replay. Analysis is strictly limited to retained records in the session journals. Findings reset on new user prompts.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
1 use
Times used to date
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 1 month ago
- Free with an Agensi account
Requires