diagnose rule

    1

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

    Free

    1 useSecurity scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    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)

    MetricValueNotes
    StatusviolationThe classifier positively identified a policy breach.
    ModeobserveThe rule is currently set to monitor-only.
    DiagnosticokNo service failures or size limits were encountered.
    Outcomeno_actionCorrection suppressed by observe-mode configuration.
    Policy Hash7a2c91...Matches the current version of the PII policy.
    Episode3Finding occurred during the third turn of the session.
    Timestamp2023-10-24T14:22:01ZEvidence 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

    1. Switch the rule to repair mode in agent-rules.config.json if you want active enforcement.
    2. Run status to verify the mode change has been picked up by the plugin.
    3. 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, 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.

    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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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

    @jvsteiner/agent-rules
    Node.js

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Environment Variables
    Listed1 month ago

    What's inside

    Frequently Asked Questions

    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.

    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.

    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.

    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.

    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.

    New in LLM Ops