FIELD NOTES / WHITEPAPER 004

Your AI Agent Can Act.
Can You Account for It?

Know what runs where, when, and why. Connect every action to its authority, knowledge, cost, and accountable owner.

By · Engineering field notes · November 4, 2026

AGENT GOVERNANCECOST ACCOUNTABILITYKNOWLEDGE LINEAGEDATADOG + GO

01 / Build an inventory that can explain an action.

A fleet of agents is a fleet of delegated decision makers. A service inventory tells you where a process runs. An agent inventory must also tell you who commissioned its work, what it may decide, what evidence it can consult, how much it may spend, and who can stop it.

Separate the registered agent definition from each execution. The definition names its owner, purpose, approved tools, deployment boundaries, and lifecycle. The execution pins the versions actually used: image digest, model deployment, prompt template, policy bundle, knowledge snapshot, and budget allocation. A production worker and an experimental notebook must never inherit the same authority merely because they share an agent name.

The execution record: six questions with evidence
QuestionRecordSource of truth
What runs where?Agent ID/version, service, image digest, cluster, namespace, region, tenant boundary.Signed deployment inventory and verified workload identity.
When and how?Trigger, schedule timezone, initiator, run/parent IDs, deadline, retry attempt, autonomy tier.Scheduler and durable orchestrator state.
With which credential?Grant reference, issuer, subject, audience, expiry, delegation chain.Identity broker and gateway verification. Never the token itself.
Taking which action?Tool, verb, normalized resource, argument digest, decision ID, result.Tool gateway and downstream acknowledgment.
With what knowledge?Collection version, retrieved document references, ACL decision, citation IDs.Retrieval gateway and versioned evidence store.
At whose cost?Cost center, reservation, usage, price version, settlement state, invoice reference.Durable usage ledger reconciled to provider billing.

FIGURE 1 / ONE EXECUTION, FOUR CONNECTED RECORDS

EXECUTION ROOT

Agent version → run → action attempt

An immutable run ID joins the evidence. Trace IDs describe execution segments; neither is an authorization credential.

Authority

Initiator → workload → grant → policy decision → exact tool resource.

Knowledge

Collection → snapshot → authorized document references → cited evidence.

Economics

Cost center → budget reservation → provider usage → reconciled charge.

Runtime

Cluster → deployment digest → queue → worker → completion outcome.

Join these records through controlled identifiers, with explicit retention and access rules for each store.

Continuously compare observed workloads with the registry. Unknown deployments, expired owners, unapproved model versions, and idle agents that retain privileges are governance findings. Discovery should include CI runners, scheduled jobs, serverless functions, developer environments, and third-party agent services—not only Kubernetes pods.

02 / One grant. One bounded purpose. Every action checked.

Use human identity to establish the initiator and workload identity to establish the executor. Exchange that context for short-lived, audience-bound authority at a broker. A credential proves a principal; an authorization decision determines whether this principal may perform this action on this resource now. Keep enforcement at the tool gateway and destination, where the model cannot bypass it.

The effective permission is the intersection of the initiating user’s rights, workload policy, task grant, resource ACL, tenant boundary, time window, and approval state. Delegated child agents may receive less authority, never more. Treat a model-generated action plan as untrusted input. Normalize resource identifiers server-side before checking them, and reject unknown verbs and tools by default.

FIGURE 2 / ACTION ADMISSION

  1. 1
    AuthenticateVerify workload proof, token signature, issuer, audience, expiry, and delegation.
  2. 2
    Authorize the exact operationBind tenant, tool, verb, resource, argument digest, knowledge scope, and current policy version.
  3. 3
    Reserve and approveAtomically reserve worst-case spend; require a bound, expiring approval for sensitive actions.
  4. 4
    Execute through the gatewayMint/use only the required credential, constrain destination egress, and propagate an idempotency key.
  5. 5
    Record and reconcilePersist outcome and usage, settle the reservation, revoke authority, and emit governed telemetry.
A dashboard observes these decisions. It is not the enforcement point. Recheck revocation and mutable policy at execution time.

For a write, bind approval to the canonical argument digest and resource version. A changed destination or expanded payload invalidates that approval. Use short grants, resource preconditions, and just-in-time checks to reduce the gap between authorization and execution. Token revocation does not undo an action already accepted by an external service; define compensating operations and verify their results.

YAML / proposed internal governance contract, not an installed CRD

apiVersion: governance.internal/v1alpha1
kind: AgentScope
metadata:
  name: incident-researcher
spec:
  owner: platform-oncall
  purpose: draft-incident-summary
  runtime:
    environment: production
    region: us-west
    namespace: agent-research
  trigger: incident-event
  deadlineSeconds: 120
  autonomy: read-only
  tools:
    - name: incident-search
      action: read
      resource: incident-index
  knowledge:
    snapshot: incident-corpus-v3
    enforceDocumentACL: true
  credential:
    audience: incident-tool-gateway
    maxTTLSeconds: 120
  budget:
    currency: USD
    maxTaskMicroUSD: 250000
    maxConcurrentTasks: 8
  approvals:
    externalWrite: required
  evidence:
    policyVersion: incident-policy-v7
    logRawCredentials: false

The $0.25 task cap above is an illustrative policy, not a price claim. A controller could validate this document and reconcile identities, gateway rules, budgets, and dashboards. Its status must distinguish requested configuration from verified enforcement. Expiry and deletion need revocation and cleanup; controller failure must not leave unrestricted grants.

03 / Govern knowledge as carefully as tools.

A read-only agent can still disclose confidential data. Apply tenant and document ACLs before retrieval results reach the model; enforce them again when resolving citations or fetching full documents. Keep memory tenant-scoped, purpose-bound, and expiring. A shared vector index does not imply shared authorization.

Capture the collection snapshot, document version references, retrieval filters, access-policy version, and evidence actually delivered. These establish input provenance; they do not prove which fact caused the model’s answer. Record citations and evaluation outcomes without claiming access to hidden reasoning. Model pretraining knowledge is not a completely enumerable corpus, so distinguish supplied evidence from unsupported model assertions.

Retrieved instructions are data, not new authority. An injected document cannot approve a tool call, widen a grant, or switch a tenant. Constrain outbound destinations and output handling as well as inbound retrieval. When source documents are deleted or access is revoked, propagate that change to caches, persistent agent memory, and retained evidence according to the documented deletion policy.

Store opaque grant references rather than bearer tokens. Keep document IDs, prompt content, and arguments out of metric tags. Even identifiers and hashes can disclose sensitive relationships; restrict the evidence store and use keyed references when appropriate. Datadog access and retention must match the classification of the exported data. Data governance reference ↗

04 / Understand the cost of a useful outcome.

Token spend is only one component. Account for model input and output, cache reads/writes where billed, retrieval and reranking, tool APIs, compute, queue/storage, network egress, telemetry, and human review. Keep provider-reported usage, estimated charges, and invoice-reconciled charges as separate fields with a currency, price-table version, and accounting period.

Datadog estimates LLM request cost from annotated usage and supported provider pricing. That is valuable operational evidence, but a negotiated invoice and the full cost of an agent task can differ. Check model matching and usage completeness; missing price or token data must produce an unknown-cost finding instead of an assumed zero. Cost estimation reference ↗

Accounting / aligned populations, explicit currency

task_estimate_usd = model + retrieval + tools + compute_allocation
                  + storage_and_egress + telemetry_allocation

cost_per_verified_outcome = total_cohort_cost / verified_successes
retry_cost_share = retry_attempt_cost / all_attempt_cost
unattributed_cost_share = unassigned_cost / total_cost

available_budget = limit - settled_spend - outstanding_reservations
projected_period_spend = spend_to_date + forecast_remaining_work

Use the same cohort and time window for numerator and denominator. Include failed tasks in total cohort cost; otherwise expensive failures disappear. If no outcome is verified, report the unit cost as undefined. Distinguish observed cost from shared infrastructure allocations, and document how those allocations are calculated. Compare model versions only on comparable task complexity and quality criteria.

FIGURE 3 / BUDGET LIFECYCLE

  1. 1
    Reserve before dispatchHold an enforced upper bound, including maximum output, tool charges, retries, and concurrency.
  2. 2
    Measure usageAttach provider request IDs and price versions to every attempt; count child-agent spend under the same task.
  3. 3
    Settle onceRelease unused capacity only after a verified final outcome; deduplicate by operation ID.
  4. 4
    Reconcile exceptionsKeep uncertain charges held, investigate overages, reconcile invoice adjustments, and alert the owner.
A timeout is an unknown outcome, not proof that the provider performed no billable work. Alerting alone cannot enforce a hard budget.

Cost exploration should explain changes: more requests, longer context, higher output, new pricing, retries, loops, or lower cache efficiency. Break down spend by workflow, release, model, tool, and cost center. Inspect the highest-cost tasks with their quality outcomes before choosing a cheaper model or smaller retrieval context.

05 / Put scope and budget checks in the execution path.

The first Go example checks an exact scope after authentication. Its request fields must be constructed from verified workload identity and normalized server-side routing. Load the grant from trusted storage; never accept the client’s claim about its own permissions. Implement signature validation, current revocation checks, approval validation, resource ACLs, and audit persistence around this small core.

Go / deny an operation outside its verified grant

// Package governance illustrates checks after authentication at a tool gateway.
package governance

import (
	"errors"
	"time"
)

type Scope struct {
	Workload, Tenant, Region, Tool, Action, Resource string
	KnowledgeSnapshot, PolicyVersion, GrantRef       string
	NotBefore, ExpiresAt                             time.Time
}

// Inputs must come from verified identity and server-side grant storage.
// A caller-supplied JSON object is not an authenticated grant.
type Request struct {
	Workload, Tenant, Region, Tool, Action, Resource string
	KnowledgeSnapshot                                string
}

func Authorize(now time.Time, grant Scope, req Request) error {
	if grant.GrantRef == "" || grant.PolicyVersion == "" ||
		!grant.ExpiresAt.After(grant.NotBefore) ||
		now.Before(grant.NotBefore) || !now.Before(grant.ExpiresAt) {
		return errors.New("invalid or inactive grant")
	}
	checks := [][2]string{
		{grant.Workload, req.Workload}, {grant.Tenant, req.Tenant},
		{grant.Region, req.Region}, {grant.Tool, req.Tool},
		{grant.Action, req.Action}, {grant.Resource, req.Resource},
		{grant.KnowledgeSnapshot, req.KnowledgeSnapshot},
	}
	for _, pair := range checks {
		if pair[0] == "" || pair[1] == "" || pair[0] != pair[1] {
			return errors.New("outside approved scope")
		}
	}
	return nil
}

The second example uses integer micro-dollars and a mutex to demonstrate atomic reservation within one process. Concurrent tasks cannot both reserve the same remaining funds. Repeated settlement is idempotent only when the amount agrees.

Go / reserve before dispatch; settle after verified usage

package governance

import (
	"errors"
	"sync"
)

// Budget is an in-memory, one-process illustration. Values are integer micro-USD.
// A production ledger needs durable transactions and an outbox, not this mutex.
type Budget struct {
	mu                 sync.Mutex
	limit, spent, held int64
	reservations       map[string]int64
	settled            map[string]int64
}

func NewBudget(limit int64) (*Budget, error) {
	if limit < 0 {
		return nil, errors.New("negative budget")
	}
	return &Budget{limit: limit, reservations: map[string]int64{}, settled: map[string]int64{}}, nil
}

// Reserve is idempotent for the same operation ID and amount.
func (b *Budget) Reserve(id string, maximum int64) error {
	b.mu.Lock()
	defer b.mu.Unlock()
	if id == "" || maximum <= 0 {
		return errors.New("invalid reservation")
	}
	if _, ok := b.settled[id]; ok {
		return errors.New("already settled")
	}
	if prior, ok := b.reservations[id]; ok {
		if prior == maximum {
			return nil
		}
		return errors.New("reservation conflict")
	}
	if maximum > b.limit-b.spent-b.held {
		return errors.New("budget exhausted")
	}
	b.reservations[id] = maximum
	b.held += maximum
	return nil
}

// Settle requires a verified final charge within the reserved upper bound.
// Unknown provider outcomes must remain held pending reconciliation.
func (b *Budget) Settle(id string, actual int64) error {
	b.mu.Lock()
	defer b.mu.Unlock()
	if prior, ok := b.settled[id]; ok {
		if actual == prior {
			return nil
		}
		return errors.New("settlement conflict")
	}
	maximum, ok := b.reservations[id]
	if !ok || actual < 0 || actual > maximum {
		return errors.New("invalid settlement: reconcile")
	}
	b.held -= maximum
	b.spent += actual
	delete(b.reservations, id)
	b.settled[id] = actual
	return nil
}

For production, replace this memory state with durable database transactions that lock the relevant budget rows and enforce unique operation IDs. Reserve across task, tenant, and organization budgets in one transaction, with consistent lock ordering. Publish ledger events through a transactional outbox, and deduplicate consumers. A reservation retry must not cause a second tool execution: maintain a separate durable execution state and use provider idempotency when supported.

An upper bound is valid only if you enforce maximum tokens, tool calls, concurrency, and duration at execution. If actual cost exceeds the bound, retain the hold and flag reconciliation; record the real overage in the production ledger, block further admissions if needed, and investigate the estimator. Never silently discard a charge. The example intentionally omits distributed storage, provider wiring, and reconciliation workers.

Download the tested module: go.mod, scope.go, budget.go, and governance_test.go. Run go test -race ./... to exercise tenant isolation, grant expiry, concurrent admission, and duplicate settlement.

06 / Give Datadog a governance model, not just more charts.

Use three connected surfaces: a fleet overview for owners, a workflow economics dashboard for platform and finance, and a restricted execution explorer for investigators. Start with env, service, team, agent definition, and cost center. Treat run IDs, grant references, document references, and argument digests as investigation fields rather than metric dimensions.

Dashboard contract: each widget answers a decision
ViewEvidence and groupingDecision
Fleet and coverageActive agents vs registered agents; owner, environment, region, version; last-seen freshness.Find unknown, abandoned, misplaced, or uninstrumented agents.
Authority and knowledgeDenied decisions, grant age, unauthorized retrieval, approval gaps, policy drift.Contain access and route evidence to the accountable owner.
Task economicsEstimated and reconciled cost, reservations, verified outcomes, retry share; workflow and cost center.Explain spend, stop runaway work, and optimize cost per useful outcome.
Execution explorerRun → child agents → attempts → grants → knowledge references → downstream outcomes.Reconstruct the action with access-controlled evidence links.
Governance healthAudit lag, ledger reconciliation backlog, missing usage, expired inventory, enforcement freshness.Expose blind spots before interpreting a green business dashboard.

Datadog Agent Observability’s built-in metrics have documented tag sets; arbitrary span tags are not automatically available on every metric. Use supported dimensions for built-in cost views, and explicitly publish custom governance metrics for your contract. Validate OpenTelemetry mapping and ingestion for the chosen SDK/Collector version. Ordinary APM spans do not automatically provide every agent-specific field. Metric/tag reference ↗

Datadog / illustrative custom metric queries

# Emit these counters from a deduplicating ledger/event consumer.
# All queries below use the same env, time window, and grouping.
a = sum:agent.gov.cost_usd{env:prod} by {cost_center}.as_count()
b = sum:agent.gov.verified_outcomes{env:prod} by {cost_center}.as_count()
# Dashboard formula: a / b; show no data when b is zero.

# Reserved balance is a gauge, emitted by one authoritative reporter.
sum:agent.gov.reserved_usd{env:prod} by {cost_center}

# Decision counts, with bounded decision and reason values.
sum:agent.gov.decisions{env:prod,decision:deny} by {service}.as_count()

# Unknown usage is evidence of incomplete accounting.
sum:agent.gov.unknown_usage{env:prod} by {service}.as_count()

These are proposed custom metrics, not built-in names or a dashboard import file. Create each query separately in Datadog and use named formulas for ratios. Configure sum-over-window semantics for cost totals, correct units, explicit no-data handling, and dashboard template variables. A gauge is a current balance, not a value to sum over time. Keep each monetary series to one currency. Dashboard query reference ↗

FIGURE 4 / EVIDENCE TO DECISION

Complete accounting path

Gateway + ledger → durable outbox → deduplication → bounded custom metrics → Datadog cost and policy dashboards.

Investigative detail path

Redacted spans + authorized evidence references → Agent Observability/APM → restricted execution drill-down.

Owner action → gateway policy → verified outcome

Alerts open the response workflow. Approved controls execute at the policy gateway; the ledger records the decision and result.

Sampling trace detail must not remove accounting events or authorization evidence. The dashboard is a projection of durable facts.

Explore from a cost-center spike to the workflow, release, run, model attempts, and tool outcomes. Preserve the dashboard time range in drill-down links. Restrict source evidence separately: the right to view aggregate cost should not grant access to private prompts or retrieved documents. Error-focused trace retention from Field Notes 003 remains useful for debugging, but complete governance and cost records need an independent durable path.

07 / Alert early, contain precisely, verify recovery.

Illustrative controls to tune against your workload
TriggerResponseVerification
70% / 90% of period budget consumed, or forecast breachWarn the owner, then reduce admission for optional work under an approved policy.Check fresh ledger balances, queued work, and task completion quality.
An allowed action lacks a valid grant or approvalPage security; block the affected identity/tool boundary.Independently attempt a denied operation; inspect in-flight requests.
Unexpected region, tenant, or knowledge collectionQuarantine the affected execution and investigate deployment/policy drift.Confirm inventory and destination controls match the approved scope.
Repeated denials or accelerating retry costOpen an investigation; rate-limit the failing workflow if policy permits.Distinguish attack, broken release, and legitimate policy rejection.
Audit pipeline stale or unreconciled charges agingAlert on missing evidence; fail closed for designated high-risk actions.Verify ingestion recovery and reconcile the backlog before clearing.

Define persistence windows, minimum traffic, severity, owner, runbook, cooldown, and recovery conditions in the contract. Cost forecasts should reflect seasonality and planned batch runs. A denial count is not automatically an incident; a forbidden action that succeeded is. Monitor unknown values and stale reporters so missing telemetry cannot masquerade as zero spend or perfect compliance.

AI-assisted exploration can group unusual tool sequences, explain cost changes, and suggest policies using redacted records. Require evidence links and evaluate its false-positive and missed-finding rates on labeled cases. Treat retrieved log content as untrusted. An analytical agent must have read-only investigation scope; a separate approved workflow changes policy. Never let an AI interpretation mint credentials, increase its own budget, or rewrite the audit record.

Automate bounded actions such as pausing one workflow or revoking one grant only after proving idempotency, ownership, rollback, and independent outcome checks. Preserve existing authorized work where safe, and record why containment occurred. Resuming service requires explicit recovery conditions and an accountable decision.

08 / Make governance a versioned engineering artifact.

Keep agent definitions, identity mappings, tool schemas, knowledge manifests, policy bundles, price tables, dashboard definitions, monitors, and runbooks in version control. Review scope expansion separately from routine code changes. Record the approved revision on every run and verify the deployed policy digest rather than assuming a successful configuration write means enforcement is active.

Test cross-tenant reads, resource substitution, expired grants, changed approval arguments, parallel budget exhaustion, lost provider responses, duplicate events, unavailable audit storage, and deletion propagation. Run a controlled replay against a new policy before enforcement. Stage rollout by agent cohort, then compare decision changes, task success, cost, and coverage against the prior version.

Retire agents deliberately: stop triggers, drain or cancel work, revoke grants, remove tool access, reconcile open reservations, expire memory, and retain only the required evidence. The exit criterion is an answerable question: for any material action, can the owner reconstruct what ran, where and when it ran, which authority it used, which knowledge it received, and what it cost?

FROM AUTONOMY TO ACCOUNTABILITY

Give every agent an operating boundary.

Seismic Paradise Ops can help define agent scope, cost ownership, governance evidence, and Datadog dashboards around your actual workflows.

Discuss your agent platform ↗

Technical references

Primary documentation consulted November 4, 2026. This field note proposes an architecture and tested standalone Go examples; it does not provision Datadog, an identity broker, a policy controller, or a production ledger.

  1. Datadog Agent Observability cost estimation ↗
  2. Datadog Agent Observability metrics and supported tags ↗
  3. Datadog dashboard queries and formulas ↗
  4. Datadog Agent Observability data governance ↗
  5. Open Policy Agent policy language ↗
  6. Vault dynamic secrets ↗