Back to Prompt Library
implementation
Define Pydantic AI LEI Audit Agent
Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.
Linked challenge: Build an LEI Verification Guardrail using Pydantic AI and GPT-5 Pro
Format
Code-aware
Lines
12
Sections
4
Linked challenge
Build an LEI Verification Guardrail using Pydantic AI and GPT-5 Pro
Prompt source
Original prompt text with formatting preserved for inspection.
12 lines
4 sections
No variables
0 checklist items
from pydantic import BaseModel, Field
from pydantic_ai import Agent
class LEIAuditResult(BaseModel):
parent_lei: str = Field(description="20-character parent LEI code")
status: str
audit_pass: bool
lei_agent = Agent(
'openai:gpt-5-pro',
result_type=LEIAuditResult,
system_prompt='Analyze corporate filing text and determine parent LEI ownership status.'
)
# Implement run execution with context dependencies...Adaptation plan
Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.
Keep stable
Hold the task contract and output shape stable so generated implementations remain comparable.
Tune next
Update libraries, interfaces, and environment assumptions to match the stack you actually run.
Verify after
Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.