Verification Hook • AI Agent SDK

VerificationHook: Protocol for verification hooks.

VerificationHook

Defined in the verification module.

AI Agent

Protocol for verification hooks.

Verification hooks are used by Agent autonomy to validate actions. They run after file writes or at configured checkpoints.

Implementations must provide:

  • name: Unique identifier for the hook
  • run(): Execute verification and return result
Diagram

Allow

Deny

Event Trigger

Hook: VerificationHook

Decision

Process

Block

Properties

ResponseField str

No description available.

Methods

Usage

python
class LintRunner:
        name = "ruff"

        def run(self, context=None):
            import subprocess
            result = subprocess.run(["ruff", "check", "."], capture_output=True)
            return VerificationResult(
                success=result.returncode == 0,
                output=result.stdout.decode()
            )

Source

View on GitHub

praisonaiagents/hooks/verification.py at line 62


Related Documentation