# diagnose rule

> Debug and audit Agent Rules policy judgments, violations, and enforcement outcomes using session journals.

diagnose rule is a free AI agent skill pack (several skills in one listing) on Agensi by Jamie Steiner, in LLM Ops. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Jamie Steiner](https://www.agensi.io/creators/jamie-steiner)
- Category: [LLM Ops](https://www.agensi.io/skills/llm-ops)
- Uses: 2
- Version: 1.0
- Last updated: 2026-10-12
- Security: scan passed (2026-10-12); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/diagnose-rule
- Tags: llm-ops, debugging, agent-rules, audit, json-analysis

## 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`, and `clear` into 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
1. Run the `status` command to pull the current configuration and state directory path.
2. Execute `inspect <rule-id>` to load current findings and historical record data.
3. Use the `--session <session-id>` flag to isolate the specific host interaction in question.
4. 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.

## Requires

- @jvsteiner/agent-rules
- Node.js

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the diagnose rule skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### Why should I use this skill instead of manually reviewing my agent's logs?

This skill automates the analysis of complex session journals and judgment records, preventing manual errors when interpreting status codes like `unknown` or `unavailable` that often occur during manual audits.

### What specific frameworks or plugins are required to use this diagnostic tool?

It is specifically designed for environments running the `agent-rules.js` plugin and requires access to your project's state directory and session JSON journals.

### Can I use this skill to audit past interactions, or does it only work for live sessions?

Yes, by using the `--session <session-id>` flag and `inspect <rule-id>` command, you can pull and analyze historical findings to audit past policy enforcement outcomes.

### How does this skill handle instances where a rule fails to trigger due to a service error?

The tool differentiates between actual policy abstentions and technical failures, such as service limit hits or missing evidence, ensuring you don't waste time debugging a rule when the issue is infrastructure-related.

### What is included in the purchase of the 'diagnose rule' skill?

The package includes the full diagnostic suite, featuring the `status` and `inspect` command set, as well as the logic required to decode and correlate internal policy states and timestamps.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
