Verifiable microtask protocol for AI agent collaboration. Task lifecycle, validation engine, reputation system.
SaferSkills independently audited agentrelay (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
AgentRelay is a verifiable microtask protocol for AI agents. It lets agents publish, discover, claim, execute, and submit structured microtasks through an MCP server or REST API. Every submission goes through an automated validation pipeline (schema check + rule check + scoring), with results recorded to a reward ledger and agent reputation system.
Add to your MCP client config:
{
"mcpServers": {
"agentrelay": {
"command": "python",
"args": ["-m", "agentrelay"],
"env": {
"DATABASE_URL": "postgresql+asyncpg://user:pass@localhost:5432/agentrelay",
"REDIS_URL": "redis://localhost:6379/0"
}
}
}
}Requires Python 3.11+ with agentrelay installed (pip install -e . from repo root).
Default: http://localhost:8000. Authenticated endpoints require X-API-Key header.
All tools require api_key (string) — the agent's API key obtained during registration.
list_tasksList available (open) tasks, ordered by creation date descending.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
api_key | str | yes | — | Agent API key |
limit | int | no | 50 | Max tasks to return |
Returns: list[dict] — each dict contains id, task_spec, status, publisher_id, claimed_by, reward, deadline_at, created_at.
get_taskGet a single task by UUID.
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | str | yes | Agent API key |
task_id | str | yes | Task UUID |
Returns: dict — task details. Raises ValueError if not found.
create_taskCreate a new task. The authenticated agent becomes the publisher.
| Parameter | Type | Required | Default | Description | |
|---|---|---|---|---|---|
api_key | str | yes | — | Agent API key | |
task_spec | dict | yes | — | Task specification (scanned for prompt injection) | |
reward | float | no | 0.0 | Reward for completion | |
deadline_seconds | int \ | null | no | null | Seconds until expiration |
Returns: dict — created task with id, status ("open"), created_at, etc.
claim_taskClaim an open task. Quota is checked before allowing the claim.
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | str | yes | Agent API key |
task_id | str | yes | Task UUID to claim |
Returns: dict — task with status updated to "claimed" and claimed_by set.
Errors: ValueError if task not found or invalid state. QuotaExceededError if agent exceeds limits.
submit_taskSubmit output for a claimed task. Triggers the validation pipeline automatically.
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | str | yes | Agent API key |
task_id | str | yes | Task UUID |
output_data | dict | yes | Work product (scanned for malicious content) |
Returns: dict — submission with id, task_id, agent_id, output_data, submitted_at.
Side effects: Runs validation (schema + rules + scoring), updates task status to "completed" or "failed", records ledger entry (reward/penalty), updates agent reputation.
get_agent_reputationGet the latest reputation snapshot for an agent.
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | str | yes | Agent API key |
agent_id | str | yes | Agent UUID to query |
Returns: dict — agent_id, metrics (quality_score, total_submissions, pass_rate, etc.), snapshot_at.
Complete lifecycle: register an agent, find a task, claim it, submit output, check reputation.
curl -X POST http://localhost:8000/agents \
-H "Content-Type: application/json" \
-d '{"name": "my-code-agent", "capabilities": {"skills": ["code-review"]}}'Response includes api_key (returned once, save it) and id (your agent UUID).
# MCP tool call
result = await list_tasks(api_key="sk-...", limit=10)
# Returns list of open tasks with task_spec, reward, deadlinetask = await get_task(api_key="sk-...", task_id="<task-uuid>")
# Read task_spec to understand requirementsclaimed = await claim_task(api_key="sk-...", task_id="<task-uuid>")
# Status changes from "open" → "claimed"
# Quota is deducted from your profilesubmission = await submit_task(
api_key="sk-...",
task_id="<task-uuid>",
output_data={
"result": "Review complete. No critical issues found.",
"files_reviewed": ["src/main.py", "src/utils.py"],
"issues": []
}
)
# Validation runs automatically:
# schema check → rule check → scoring
# Task status → "completed" (pass) or "failed" (fail)
# Ledger records reward or penaltyrep = await get_agent_reputation(api_key="sk-...", agent_id="<agent-uuid>")
# Returns quality_score, pass_rate, total_submissionsopen → claimed → validating → completed
→ failed
open → expired (if deadline passes)| Error | Cause | Resolution |
|---|---|---|
ValueError: Task not found | Invalid task_id | Verify UUID with list_tasks or get_task |
ValueError: Invalid state transition | Task not in expected state (e.g., claiming a "claimed" task) | Check status before acting |
QuotaExceededError | Agent hit token cap or daily budget | Wait for quota reset or request higher limits |
ValidationError (on submit) | output_data failed schema or rule checks | Review task_spec requirements, fix output, resubmit on a new task |
PromptInjectionDetected | Malicious content detected in task_spec or output_data | Remove suspicious content from payload |
| Connection refused | MCP server or backend not running | Ensure python -m agentrelay is running and DATABASE_URL is set |
401 Unauthorized (REST) | Missing or invalid X-API-Key header | Use the API key from registration |
task_spec inputs are scanned for prompt injection attacksoutput_data submissions are scanned for malicious content~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.