Catalog PyPI
PACKAGE EXPLORERView in registry

agent-gates

PyPI

Quality gates for AI agent output validation

agentaigatesllmqualityvalidation
Versions collected1
Direct dependencies4From release 0.1.0
Last observed20 Oct, 22:02 UTC

README

Version 0.1.0 documentation

Agent Gates

Quality gates for AI agent output validation.

A framework for validating AI agent outputs with configurable gates. Designed for Claude, GPT, and other LLM-based agents.

Installation

pip install agent-gates

Quick Start

from agent_gates import GatePipeline

# Use a preset pipeline
pipeline = GatePipeline.from_preset("standard")
result = pipeline.check("This should work")

if not result.passed:
    print(result.to_markdown())

Presets

PresetDescription
strictAll gates as blocking - no hedging, no apologies, no assumptions
standardCommon gates with sensible defaults
minimalOnly critical gates (hedging, unverified claims, credentials)
code_reviewFocused on code quality (TODOs, debug prints, magic numbers)

Custom Gates

from agent_gates import Gate, GatePipeline

# Create a custom gate
no_emoji = Gate(
    name="no_emoji",
    pattern=r"[\U0001F600-\U0001F64F]",
    action="warn",
    message="Response contains emoji",
    suggestion="Remove emoji for professional output"
)

# Build a custom pipeline
pipeline = GatePipeline("my_pipeline")
pipeline.add_gate(no_emoji)

# Or combine with a preset
pipeline = GatePipeline.from_preset("standard")
pipeline.add_gate(no_emoji)

Gate Types

Language Gates

  • HEDGING_GATE - Blocks "should work", "might be", "probably"
  • APOLOGY_GATE - Blocks "I apologize", "sorry for"
  • SYCOPHANCY_GATE - Blocks "great question", "you're absolutely right"
  • ASSUMPTION_GATE - Warns on "I'll assume", "let's assume"

Verification Gates

  • UNVERIFIED_CLAIM_GATE - Blocks claims without verification evidence

Completeness Gates

  • TODO_GATE - Blocks incomplete work marked as TODO
  • DEFERRAL_GATE - Blocks "I'll do it later", "for now"

Security Gates

  • CREDENTIAL_GATE - Blocks exposed passwords, API keys, tokens

Code Review Gates

  • MAGIC_NUMBER_GATE - Info on large numeric literals
  • DEBUG_PRINT_GATE - Warns on console.log, print()
  • COMMENTED_CODE_GATE - Info on commented-out code

API Reference

Gate

Gate(
    name: str,                    # Unique identifier
    pattern: str = None,          # Regex pattern (match = failure)
    check_fn: Callable = None,    # Custom function (True = failure)
    escape_pattern: str = None,   # Pattern that exempts from check
    action: str = "block",        # "block", "warn", or "info"
    message: str = "",            # Human-readable failure message
    suggestion: str = "",         # How to fix the issue
    category: str = "custom",     # Category for grouping
    enabled: bool = True          # Can be disabled dynamically
)

GatePipeline

pipeline = GatePipeline(name="my_pipeline")
pipeline.add_gate(gate)           # Add a gate
pipeline.remove_gate("name")      # Remove by name
pipeline.disable_gate("name")     # Disable temporarily
pipeline.enable_gate("name")      # Re-enable
result = pipeline.check(text)     # Run all gates

GateResult

result.passed          # bool - True if no blocking failures
result.failures        # list[GateFailure] - blocking issues
result.warnings        # list[GateFailure] - non-blocking issues
result.info            # list[GateFailure] - informational
result.to_markdown()   # Formatted output
result.to_dict()       # Serializable dict

Utility Functions

from agent_gates import quick_check, get_failures

# Boolean check
if quick_check(text, "standard"):
    print("Passed!")

# Get failure messages
failures = get_failures(text, "strict")
for msg in failures:
    print(msg)

Serialization

Pipelines can be serialized for storage or configuration:

# Save
config = pipeline.to_dict()
json.dump(config, open("pipeline.json", "w"))

# Load
config = json.load(open("pipeline.json"))
pipeline = GatePipeline.from_dict(config)

License

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.029 Apr 20264

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

NOT_FOUND
coldforge/agent-gates

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:02 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:f7b485a65c28515fcae1acf4ca4724fe03ae0b0e796452cfc69acc07de29a762