Agentic RTB Framework - Implementation Specification
This document provides a comprehensive specification for the Go reference implementation of the IAB Tech Lab's Agentic RTB Framework (ARTF) v1.0.
Overview
Protocol Definition
Project Structure
API Specification
Message Types
Intents and Operations
Server Endpoints
Container Requirements
Build and Deployment
Configuration
The Agentic RTB Framework (ARTF) defines a standard for implementing agent services that operate within a host platform's infrastructure to process bidstream data in real-time. This implementation provides:
Segment Activation - Activate user segments based on bid request data
Deal Management - Activate, suppress, and adjust deals dynamically
Bid Shading - Optimize bid prices using intelligent pricing strategies
Metrics Addition - Add viewability and other metrics to impressions
Agents participate in the core bidstream - Real-time transaction processing
Agents accomplish specific goals - Each agent declares specific intents
Agents are composable and deployable - OCI containers, Kubernetes-ready
Agents are performant - gRPC/protobuf, sub-millisecond latency
Agents follow least-privilege - No external network access, minimal data exposure
syntax = "proto2" ;
package com.iabtechlab.bidstream.mutation.v1 ;
service RTBExtensionPoint {
// GetMutations returns RTBResponse containing mutations to be applied
// at the predetermined auction lifecycle event
rpc GetMutations (RTBRequest ) returns (RTBResponse );
}
Attribute
Value
Protocol
gRPC over HTTP/2
Serialization
Protocol Buffers (proto2)
Default Port
50051
TLS
Recommended for production
agentic-rtb-framework/
├── cmd/
│ └── server/
│ └── main.go # Server entry point
├── internal/
│ ├── handlers/
│ │ └── handlers.go # Mutation handlers
│ ├── health/
│ │ └── health.go # Health check endpoints
│ └── server/
│ └── server.go # gRPC service implementation
├── pkg/
│ └── pb/ # Generated protobuf code
│ ├── artf/ # ARTF messages and service
│ └── openrtb/ # OpenRTB v2.6 messages
├── proto/
│ ├── agenticrtbframework.proto
│ └── com/iabtechlab/openrtb/v2.6/
│ └── openrtb.proto
├── scripts/
│ └── generate.sh # Protobuf generation script
├── docs/
│ └── SPECIFICATION.md # This file
├── CLAUDE.md # AI assistant instructions
├── README.md # Project readme
├── Dockerfile # Container build
├── docker-compose.yml # Local development
├── Makefile # Build automation
├── go.mod # Go module definition
└── go.sum # Dependency checksums
The request message sent from the orchestrator to the agent.
Field
Type
Required
Description
lifecycle
Lifecycle
Yes
Auction lifecycle stage
id
string
Yes
Unique request ID assigned by exchange
tmax
int32
Yes
Maximum response time in milliseconds
bid_request
BidRequest
Yes
OpenRTB v2.6 bid request
bid_response
BidResponse
No
OpenRTB v2.6 bid response (if available)
ext
Extensions
No
Extension fields
The response message returned by the agent.
Field
Type
Required
Description
id
string
Yes
Request ID (must match request)
mutations
Mutation[]
No
List of proposed mutations
metadata
Metadata
No
Response metadata
A single atomic change proposed to the bid request or response.
Field
Type
Required
Description
intent
Intent
Yes
Purpose of the mutation
op
Operation
Yes
Operation type (add/remove/replace)
path
string
Yes
Semantic path to target data
value
oneof
Yes
Payload (type depends on intent)
Optional metadata about the response.
Field
Type
Description
api_version
string
Version of the agent API
model_version
string
Version of the ML model (if applicable)
Used for segment and deal ID lists.
message IDsPayload {
repeated string id = 1 ;
}
Used for deal floor and margin adjustments.
message AdjustDealPayload {
optional double bidfloor = 1 ;
optional Margin margin = 2 ;
}
message Margin {
optional double value = 1 ;
optional CalculationType calculation_type = 2 ;
enum CalculationType {
CPM = 0 ; // Absolute margin
PERCENT = 1 ; // Relative margin (percentage)
}
}
Used for bid price adjustments.
message AdjustBidPayload {
optional double price = 1 ;
}
Used for adding impression metrics.
message AddMetricsPayload {
repeated Metric metric = 1 ; // OpenRTB Metric objects
}
Value
Name
Description
0
INTENT_UNSPECIFIED
Unspecified (invalid)
1
ACTIVATE_SEGMENTS
Activate user segments by external segment IDs
2
ACTIVATE_DEALS
Activate deals by external deal IDs
3
SUPPRESS_DEALS
Suppress deals by external deal IDs
4
ADJUST_DEAL_FLOOR
Adjust the bid floor of a specific deal
5
ADJUST_DEAL_MARGIN
Adjust the deal margin of a specific deal
6
BID_SHADE
Adjust the bid price of a specific bid
7
ADD_METRICS
Add metrics to an impression
Value
Name
Description
0
OPERATION_UNSPECIFIED
Unspecified (invalid)
1
OPERATION_ADD
Add new data to the target
2
OPERATION_REMOVE
Remove data from the target
3
OPERATION_REPLACE
Replace existing data at the target
Intent
Expected Payload
Path Example
ACTIVATE_SEGMENTS
IDsPayload
/user/data/segment
ACTIVATE_DEALS
IDsPayload
/imp/{id}
SUPPRESS_DEALS
IDsPayload
/imp/{id}
ADJUST_DEAL_FLOOR
AdjustDealPayload
/imp/{id}/pmp/deals/{dealId}
ADJUST_DEAL_MARGIN
AdjustDealPayload
/imp/{id}/pmp/deals/{dealId}
BID_SHADE
AdjustBidPayload
/seatbid/{seat}/bid/{bidId}
ADD_METRICS
AddMetricsPayload
/imp/{id}/metric
Port
Service
Method
Description
50051
RTBExtensionPoint
GetMutations
Process bid request and return mutations
Health Check HTTP Endpoints
Port
Path
Method
Description
8080
/health/live
GET
Liveness probe - returns 200 if process is alive
8080
/health/ready
GET
Readiness probe - returns 200 if ready for traffic
{
"status" : " ready" ,
"ready" : true ,
"version" : " 1.0.0"
}
Security Requirements (per ARTF spec)
Requirement
Implementation
Non-root user
USER 65534:65534 in Dockerfile
Drop capabilities
cap_drop: ALL in docker-compose
Read-only filesystem
read_only: true in docker-compose
No privilege escalation
no-new-privileges: true
Network isolation
Configurable via network policies
Resource
Default
Description
CPU Limit
500m
0.5 CPU cores
Memory Limit
256Mi
256 MB RAM
CPU Request
250m
0.25 CPU cores
Memory Request
128Mi
128 MB RAM
livenessProbe :
httpGet :
path : /health/live
port : 8080
initialDelaySeconds : 10
periodSeconds : 5
readinessProbe :
httpGet :
path : /health/ready
port : 8080
initialDelaySeconds : 5
periodSeconds : 5
Go 1.22+
Protocol Buffers compiler (protoc)
protoc-gen-go and protoc-gen-go-grpc plugins
Docker (for containerized deployment)
Command
Description
make deps
Download Go dependencies
make generate
Generate protobuf Go code
make build
Build server binary
make test
Run unit tests
make test-coverage
Run tests with coverage report
make lint
Run linter
make clean
Remove build artifacts
Command
Description
make run
Run server locally
make docker-build
Build Docker image
make docker-run
Run Docker container
make docker-compose-up
Start with docker-compose
make docker-compose-down
Stop docker-compose services
Command
Description
make grpc-test
Test gRPC endpoint with grpcurl
make health-check
Check health endpoints with curl
Flag
Default
Description
-grpc-port
50051
gRPC server listening port
-health-port
8080
Health check HTTP server port
Variable
Description
GRPC_PORT
Override gRPC port
HEALTH_PORT
Override health check port
Agent Manifest (Container Label)
The container image must include an agent-manifest label with JSON metadata:
{
"name" : " artf-agent" ,
"version" : " 1.0.0" ,
"vendor" : " your-organization" ,
"owner" : " team@example.com" ,
"resources" : {
"cpu" : " 500m" ,
"memory" : " 256Mi"
},
"intents" : [
" ACTIVATE_SEGMENTS" ,
" ACTIVATE_DEALS" ,
" SUPPRESS_DEALS" ,
" ADJUST_DEAL_FLOOR" ,
" BID_SHADE"
],
"dependencies" : {},
"health" : {
"livenessProbe" : {
"httpGet" : { "path" : " /health/live" , "port" : 8080 }
},
"readinessProbe" : {
"httpGet" : { "path" : " /health/ready" , "port" : 8080 }
}
},
"security" : {
"runAsNonRoot" : true ,
"dropCapabilities" : [" NET_ADMIN" , " SYS_PTRACE" ]
}
}
{
"intent" : " ACTIVATE_SEGMENTS" ,
"op" : " OPERATION_ADD" ,
"path" : " /user/data/segment" ,
"ids" : {
"id" : [" demo-18-24" , " sports-enthusiast" , " premium-user" ]
}
}
{
"intent" : " ACTIVATE_DEALS" ,
"op" : " OPERATION_ADD" ,
"path" : " /imp/1" ,
"ids" : {
"id" : [" deal-001" , " deal-002" ]
}
}
{
"intent" : " ADJUST_DEAL_FLOOR" ,
"op" : " OPERATION_REPLACE" ,
"path" : " /imp/1/pmp/deals/deal-001" ,
"adjust_deal" : {
"bidfloor" : 5.50
}
}
{
"intent" : " BID_SHADE" ,
"op" : " OPERATION_REPLACE" ,
"path" : " /seatbid/seat-1/bid/bid-123" ,
"adjust_bid" : {
"price" : 4.25
}
}
Document Version: 1.0.0
Last Updated: November 2025