AI Inbound — Standalone Job¶
A job designed to be driven by an external AI agent. The AI_INBOUND gate strategy allows an LLM to resolve job configuration automatically.
Source¶
examples/standalone/showcase/jobs/ai_jobs.py (the ai_review job)
Running¶
# Manual execution with explicit config
cd examples/standalone/showcase
func ai-review --repo my-org/my-repo --focus security
# Expose as MCP tool for AI agents
func mcp serve
Key Concepts¶
- AI_INBOUND gate — An LLM resolves unset config fields from conversation context
visibility="external"— Marks the job for MCP exposure to AI agentsMockAI— Deterministic AI testing double (no API keys needed)ToolScope.only()— Restrict which tools the AI can use during execution- Structured output —
response_model=ReviewResultreturns typed Pydantic objects
How AI_INBOUND Works¶
When this job is exposed via MCP and an external AI agent calls it:
- Agent calls
run_job("ai_review")without providing all config fields - The gate system detects unresolved fields (e.g.,
repois missing) - AI_INBOUND strategy asks the LLM to resolve them from conversation context
- If AI can't resolve, falls back to PROMPT (or config chain defaults)
- Job executes with the fully resolved config