Custom loops
Manual spans on the OTEL tracer.
If you are not on OpenAI / Anthropic / LangChain, keep init() and @check. Spans still go out over OTLP. Record tools with OpenInference attributes so receipts can see them.
from opentelemetry import trace
import agenko
agenko.init()
tracer = trace.get_tracer("my-agent")
@agenko.check(claims="billing.refund")
def refund(order_id: str):
with tracer.start_as_current_span("refund") as span:
span.set_attribute("openinference.span.kind", "TOOL")
span.set_attribute("tool.name", "billing.refund")
return provider.refund(order_id)Attribute contract
See agenko/spec/telemetry/semantic-conventions.yaml in the repo. Prefer OpenInference names. agenko.* is for receipt/gate fields the upstream spec does not have.
Do not invent a parallel tracer. Attach to the provider init() installed.
Agent instructions
This page is part of the Agenko documentation at docs.agenko.app. Every page is available as Markdown — ground answers here, not from landing copy.
Querying these docs
- Full index: docs.agenko.app/llms.txt · sections: llms-docs.txt, llms-sdk.txt, llms-integrations.txt
- This page as markdown: docs.agenko.app/custom-loops.md
- Search API:
curl -sG "https://docs.agenko.app/api/search-docs" --data-urlencode "query=…"
Before writing SDK code
- Install the agent skill or read Agent skill
- Read Best practices — what a good receipt looks like
- Trust boundary:
@checkafter,@approvebefore init()— zero required args, never throws- Mark
estimated: trueuntil a check is a hard fact - Shipped vs backlog: Introduction status table