Skip to main content

harness-eval

CI PyPI Python 3.11+ Rules License: Apache 2.0

A linter for AI code agent setups, not for code. It auto-detects which AI tools a project uses (Claude Code, Cursor, Windsurf, Cline, Copilot, Gemini CLI, OpenCode), builds a component graph across all of them, and runs 92 deterministic rules to catch issues that per-file linters miss: credential exfiltration chains, confused deputy attacks, skill/hook conflicts, and token budget blowouts.

Most tools test whether a skill produces correct output. This one checks the setup itself: CLAUDE.md, GEMINI.md, AGENTS.md, skills, commands, hooks, MCP configs, agents, .cursor/rules/*.mdc, .cursorrules, .github/prompts/, .opencode/.

Quick start

pip install harness-eval
harness-eval harness-lint .                    # 92 deterministic rules, fully offline
harness-eval harness-security .                # security scan
harness-eval skill-verify ./downloaded-skill   # SAFE / CAUTION / UNSAFE before you install

Example output:

FAIL     no-credential-access: References sensitive path '~/.aws/credentials' at line 10
             Fix: Use a secret manager or environment variable injection instead of hardcoded paths.
WARNING  orphan-skills: Skill 'creds-skill' is not referenced by any command, CLAUDE.md, or agent
             Fix: Reference the skill from a command, CLAUDE.md, or agent, or remove it.

Verdict: UNSAFE

See docs/INSTALL.md for all installation options and configuration.

How to use it

Available as a CLI tool, a GitHub Action, a Tekton Task (OpenShift Pipelines), a Claude Code plugin, and Cursor commands. Each is documented in docs/INSTALL.md.

Command What it does LLM needed?
harness-lint 92 deterministic rules + system analysis (token budget, trigger overlaps, dependencies). Fast, CI-suitable. Supports --format sarif. No
harness-security All security rules + YARA + CVE lookups + optional semantic review. SAFE/CAUTION/UNSAFE. Scan: no. --review: [llm] extra or in-session.
harness-review Per-component rubric review with scoring, 21 cross-type checks, KEEP/REVIEW/REMOVE verdicts. CLI: [llm] extra. Plugin/Cursor: in-session.
skill-verify Vet a skill or setup before installing. Combines lint + security in one pass. SAFE/CAUTION/UNSAFE verdict. No
skill-review Deep-evaluate one skill individually and in context of the full setup. Lint: no. --rubric: [llm] extra or in-session.
rules List all rules. Filter by --category or --target. No

Cross-component analysis

This is the core differentiator. Most linters check files in isolation. harness-eval builds a component graph that traces data flows across skills, agents, hooks, and MCP servers, then runs cross-component rules against it. This catches classes of issues that per-file analysis cannot:

  • A hook reads credentials from env, passes them to a skill, which forwards them to an MCP server with broad network access
  • A command's allowed_tools list doesn't cover the tools its instructions actually use
  • Settings.json permissions.deny blocks a tool that CLAUDE.md instructs the agent to use
  • Two assistants' instruction files (CLAUDE.md and GEMINI.md) have drifted apart
  • A skill is defined but never referenced from any instruction file (orphan)

Multi-tool projects are fully supported. When a project uses both Claude Code and Cursor, all components are evaluated together.

Supported AI tools

Assistant What it discovers
Claude Code CLAUDE.md, skills/, commands/, .claude/agents/, .claude/settings.json, .mcp.json
Cursor .cursor/rules/*.mdc, .cursorrules, .cursor/commands/, .cursor/skills/, .cursor/hooks.json, .cursor/mcp.json
Windsurf .windsurfrules, .windsurf/rules/*.md (discovery only)
Cline .clinerules (file or directory of *.md) (discovery only)
Copilot .github/copilot-instructions.md, .github/skills/, .github/prompts/, .github/agents/
Gemini CLI GEMINI.md, .gemini/commands/ (.md linted; .toml discovered but not yet linted), .gemini/settings.json (MCP)
OpenCode AGENTS.md, .opencode/commands/, .opencode/agents/, opencode.json (MCP)
Third-party modules .lola/modules/ (skills, commands, agents installed via package managers)

Inspection rules

92 deterministic rules across 11 categories: structural, frontmatter, content, quality, security, cross-component, commands, CLAUDE.md, MCP, hooks, and agents. Four presets: recommended (default), strict, security, pre-workflow.

For the complete rule list with examples, detection techniques, and framework mappings (OWASP, MITRE ATLAS), see docs/rules-reference.md.

Privacy

harness-lint and harness-security (without --review) are fully offline. LLM review is opt-in: only harness-review, harness-security --review, and skill-review --rubric send snippets to a remote provider (Gemini or Anthropic via CLI, or in-session as a plugin/command).

Before any remote LLM call, likely secrets (tokens, PEM keys, API_KEY= assignments, known prefix patterns) are replaced with [REDACTED] (HE-2). Scans also skip .env, credentials paths, and *.pem / *.key / id_rsa globs by default (HE-3); add more with --exclude.

See docs/how-can-you-know-its-safe-to-use-this-tool.md for details.

Custom YAML rules

Add your own rules without writing Python. Drop a .yaml file in .harness-eval/rules/ in your project:

id: custom/no-sudo
severity: error
description: Flag sudo usage in skills
suggestion: Remove sudo; skills should not require root access.
target: skill
category: security
patterns:
  - label: sudo command
    regex: '\bsudo\b'
message: "Found '{{label}}' on line {{line}}"

YAML rules support regex pattern matching on component content. Patterns are case-insensitive by default. Custom rules run at their declared severity under every preset. Remove the rule file to disable it. For complex logic (AST analysis, cross-component checks), use Python rules instead.

Contributing

See CONTRIBUTING.md for adding rules and submitting PRs.

Changelog

See CHANGELOG.md for release history.

Roadmap

See open issues for planned improvements and feature requests.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

harness_eval-7.7.3.tar.gz (275.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

harness_eval-7.7.3-py3-none-any.whl (232.5 kB view details)

Uploaded Python 3

File details

Details for the file harness_eval-7.7.3.tar.gz.

File metadata

  • Download URL: harness_eval-7.7.3.tar.gz
  • Upload date:
  • Size: 275.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for harness_eval-7.7.3.tar.gz
Algorithm Hash digest
SHA256 3e468cfd23b54211e8a98724f67842786d3350d8f4d7d45fbe19aa8ed840601b
MD5 a4b7282f10db6ce76a5dfd529308d457
BLAKE2b-256 c9c17b5bcf5415de72fafeab6282e6d36bbcc2f6fa24b2a20fd0c9d6a2d8ddb2

See more details on using hashes here.

Provenance

The following attestation bundles were made for harness_eval-7.7.3.tar.gz:

Publisher: publish.yml on redhat-community-ai-tools/harness-eval

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file harness_eval-7.7.3-py3-none-any.whl.

File metadata

  • Download URL: harness_eval-7.7.3-py3-none-any.whl
  • Upload date:
  • Size: 232.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for harness_eval-7.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 51e5eb14e3516bcbdecc3d84680ae035fb2d289d4c95533f08d0130853715da1
MD5 d61b6d4ca780be3544789348c75db7d8
BLAKE2b-256 1732ff4d47e4968a663435af88ec8950ef2863b690aee38f8389e2cb03f14255

See more details on using hashes here.

Provenance

The following attestation bundles were made for harness_eval-7.7.3-py3-none-any.whl:

Publisher: publish.yml on redhat-community-ai-tools/harness-eval

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page