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
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%
graph TD
event["Event Trigger"] --> hook["Hook: VerificationHook"]
hook --> decision{"Decision"}
decision -- "Allow" --> proc["Process"]
decision -- "Deny" --> block["Block"]
style hook fill:#189AB4,color:#fff
style event fill:#8B0000,color:#fff
style proc fill:#8B0000,color:#fff
style block fill:#8B0000,color:#fffProperties
ResponseField
strNo description available.
Methods
Usage
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 GitHubpraisonaiagents/hooks/verification.py at line 62