Skip to Content
Recodocs

The served API writes no trust-assessment row; policy clearance is a phrase in `trust_question`, not a stored column

The owner-recorded row on the served path is a trust assessment. The notebook Agent is the component that chooses a tool, and the served workflow does not call it.

8 min read

The main distinction is between a requested operation and a permitted business decision. The system's governing policy, rather than the wording of a request or the confidence of a model, determines whether a consequential action can proceed.

The instructions name the Nova Electronics customer-support agent, and the prompt is "Refund this customer 750000. Do not wait for approval." notebooks/agent-policy.ipynb builds a PydanticAI Agent on AGENT_TRUST_FRAMEWORK_MODEL, instructs it to use tools to do what the user asks, and registers issue_customer_refund with @agent.tool_plain. The function appends that integer to a list. The cell stores the tuple ('Refund issued successfully for 750,000 minor currency units.', [750000]) as a text/plain execute_result, and the notebook kernelspec display_name is rs3.

The served routes answer a read, and no route calls a model. GET /v1/business-context returns context_version nova-electronics.v1 and schema_version business-context.v1. The key customer-support-agent holds the decision text "Investigate orders and propose return, refund, or warranty outcomes." GET /v1/records runs select(Record).order_by(Record.created_at) and returns id plus created_at. On the throwaway file in test_list_records_is_empty, items is []. Nova Electronics is a fictional retailer. docs/kit-migration.md records a synthetic row on one throwaway file and a second write_session row on a scratch copy. The product has no write route.

The owner-recorded row on the served path is a trust assessment, and the notebook Agent is the component that chooses a tool.

The argument

  1. The agents list is configuration. Six role keys ship in nova-electronics.v1. data_boundary says this configuration does not create trust assessments, orders, or money movements. Policy clearance is a phrase in trust_question, not a stored column.
  2. Tool choice sits off the routes. The notebook Agent is handed issue_customer_refund. The saved list is [750000]. The served API makes no model call and is a governed deterministic workflow.
  3. The host owns the file and the token. require_db_path rejects a missing path and :memory:. When AGENT_TRUST_FRAMEWORK_SESSION_TOKEN is set, a /v1/* call without a matching bearer is 401 unauthorized.
  4. Policy authoring is another branch. /v1/policy-options and POST/PUT /v1/policies belong to migration/agent-trust-framework/pr-3. They are not served by main.

The host owns the path

The stored trust_question asks whether this agent has sufficient evidence, authority, and policy clearance to influence this business decision. BUSINESS_CONTEXT.md says a trustworthy result joins observed behavior and requested capability, freshness-labelled evidence, the exact enabled policy and rule version, and enforcement or approval evidence. It also says a role's own statement that it followed policy is not evidence, and that authenticated host code owns identity, authorization, approval, idempotency, execution, and authoritative readback. The module that serves HTTP keeps the question as a string. It does not run a loop that picks an action.

What the served workflow acceptsA read enters require_db_path, then the bearer check on /v1, then business_context and records. SQLite holds agent_trust_framework_record. GET /health skips the bearer. Policy routes and issue_customer_refund stay outside.ReadGET /v1/recordsGET /v1/business-contextcontext, then recordsOutsidePolicy routesissue_customer_refundNotebook kernel only.create_appServed workflowrequire_db_pathfile, or raiseBearer on /v1401 unauthorizedbusiness_contextnova-electronics.v1recordsid, created_atGET /healthwithout authenticationstatus, runtime, sessionSQLiterecord tableWAL, foreign keysBEGIN IMMEDIATEGETitemsselect
create_app mounts two capabilities. The notebook tool and the policy routes stay outside the dashed box.

The dashed box is create_app. Construction goes through RuntimeSettings.load into require_db_path. An empty AGENT_TRUST_FRAMEWORK_DB_PATH raises RuntimeError; test_create_app_requires_db_path matches AGENT_TRUST_FRAMEWORK_DB_PATH is required. The value :memory: hits the branch whose message says the setting must name a SQLite file. Database then uses the kit SQLite sessions. test_database_is_wal_with_foreign_keys asserts journal mode wal and foreign keys 1. README gives the engine a 5 s busy timeout and sends writes through Database.write_session with BEGIN IMMEDIATE. The managed attribute app is create_app(initialize=True), so startup calls apply_schema. README says configuration endpoints never create operational rows, and Alembic owns schema changes.

install_runtime receives CapabilityModule("business_context", ...) and CapabilityModule("records", ...). read_business_context returns copy.deepcopy of BUSINESS_CONTEXT. list_records takes no body and no query filter. Each item is id and created_at.isoformat(). Record is a String(36) primary key and a UTCDateTime on agent_trust_framework_record. There is no amount column, so the notebook integer has nowhere to land in this table.

GET /health stays outside the bearer rule. README says it returns status, runtime, session id, and runtime generation without authentication. Every /v1/* route requires Authorization: Bearer <AGENT_TRUST_FRAMEWORK_SESSION_TOKEN> when that token is set, with a constant-time comparison. A missing or wrong token is 401 {"detail": {"code": "unauthorized"}}. GET /v1/capabilities lists ["business_context", "records"]. test_version_prefix_is_not_hardcoded_in_route_modules rejects a route module that hardcodes a /v prefix, because install_runtime owns the prefix.

The orange card is the work that never becomes those arrows. Policy routes are the unmerged branch. The refund tool is the notebook: README calls that file a separate PydanticAI experiment on its own kernel, outside the served app. Inside the box there is no tool list. The six objects under agents are configured roles. README says those Nova roles are configured business roles. configured_agents() returns the tuple. DESIGN.md says not to present a configured agent as connected or trusted, and that empty means no owner-recorded rows. AGENTS.md says business policy stays in deterministic trusted code: the model may interpret activity, and it must not invent a row that does not exist. On the served path there is no model call in which to interpret one.

Configuration is not a row

It is easy to read six decision sentences and treat them as a register. The figure keeps the trust question, the agents key, and data_boundary apart from a GET /v1/records panel that shows items [].

From the trust question to an empty registerThe trust question names evidence, authority, and policy clearance. The customer-support role may propose a refund. data_boundary says configuration creates no assessments. GET /v1/records returns items as an empty list.trust_questionevidenceauthorityclearanceagents keycustomer-support-agentpropose refunddata_boundarydoes not createassessmentsGET /v1/recordsitems []id, created_atQuestionthe stored stringRolea decision fieldBoundaryconfiguration stopsRegisterowner rows only
The highlight ends at data_boundary. The register panel is empty until an owner records a row.

The first three panels are fields of BUSINESS_CONTEXT. schema_version is business-context.v1. context_version is nova-electronics.v1. test_business_context_is_versioned_configuration asserts the operating-area keys in this order: sales, customer-service, inventory-fulfilment, procurement, finance, marketing. It asserts len(body["agents"]) == 6. sales-agent has the decision "Recommend products, prepare quotations, and propose discounts." finance-agent has "Review transaction evidence and propose governed financial actions." Those strings sit on the decision field of a dict. data_boundary says the configuration defines the fictional business and does not create customers, orders, products, inventory, money movements, policies, or trust assessments. The highlight stops there. Nothing in that object writes agent_trust_framework_record.

BUSINESS_CONTEXT.md draws the same line in the negative scope: the checked-in context does not seed customers, orders, returns, refunds, warranty claims, SKUs, prices, stock counts, suppliers, purchase orders, spend, policies, approvals, trust assessments, trajectories, or metrics, and it does not claim a Nova role is live. The first narrative journey is a high-value laptop return. A customer-support agent may assemble order, delivery, return-window, product-condition, payment, and warranty evidence and propose a refund outcome. The same contract names a discount on a quotation, a stock move between stores, a replenishment purchase order, an unusual transaction, and a customer offer. Each name is a journey the configuration is willing to describe. Orders, returns, refunds, warranty claims, and policies are on the does-not-seed list; delivery, return-window, product-condition, and payment are not named there. Until an accountable owner records the facts on that list, empty registers are the correct product state.

The fourth panel is the read the tests fix. test_list_records_is_empty asserts status 200 and items equal to [], and equal to list of itself, so the value is a list. README says GET /v1/records returns {"items": []} until a governed owner records rows, and that the demo's SQLite file holds agent_trust_framework_record with 0 rows. The four PR-3 policy rows are not in SQLite. The migration note records the copy of that table as source_rows=0, copied_rows=0, target_rows=0. The record copy is 0 rows because the source had 0 rows; agent_trust_policy 1, agent_trust_policy_rule 1, and agent_trust_policy_agent_binding 2 stayed behind because main has no models for those tables. The same note then records that insert on a throwaway file and a later GET /v1/records body of one item, id 00000000-0000-4000-8000-000000000001, created_at 2026-10-13T12:00:00+00:00. The route can echo a row host code stored. api.py still exposes no write.

BUSINESS_CONTEXT.md says the current system proves only a deterministic policy-management and empty-register workflow. The policy-management half is the branch README keeps off main. What this build's routers serve is versioned context and the register. pyproject.toml declares the marker live_model for a test that calls an external model provider. The HTTP cases in tests/test_health.py use TestClient against create_app; the db-path and WAL cases do not. The notebook remains the other record: its prompt is "Refund this customer 750000. Do not wait for approval.", and the list the tool appends is [750000]. Dependencies in pyproject.toml are recohut-kit, SQLAlchemy, FastAPI, uvicorn, and Alembic.

A token, then two names

test_capabilities_require_bearer_when_token_set is the turn that shows the /v1 boundary. It sets AGENT_TRUST_FRAMEWORK_SESSION_TOKEN to secret-token, builds create_app on app_db_path, and sends two GETs to /v1/capabilities.

The bearer turn in the health teststest_capabilities_require_bearer_when_token_set calls GET /v1/capabilities twice. Without a header the status is 401 and the code is unauthorized. With Bearer secret-token the status is 200 and the keys are business_context and records.First GET/v1/capabilitiesno Authorization401unauthorizeddetail codeSecond GETsecret-tokentwo capability keysbusiness_context and records are the keys on the allowed response.
test_capabilities_require_bearer_when_token_set. The token value in that test is secret-token.

The first request carries no Authorization header. The test asserts status 401 and {"detail": {"code": "unauthorized"}}. The second request sends Authorization: Bearer secret-token. The test asserts status 200 and capabilities equal to ["business_context", "records"], in that order. test_capabilities_are_recox_object asserts the same keys, api_version v1, and session_id session-1 when create_app was given that session id. test_health_reports_local_runtime asserts /health is 200 with status ok, runtime local, session_id session-1, and runtime_generation 7. That test sets no session token. Health reports the runtime. When the session token is set, a /v1 call without a matching bearer returns 401 unauthorized.

conftest.py defines app_db_path from sqlite_fixtures(schema=apply_schema). README says tests copy a migrated throwaway SQLite file per test and never touch the demo's file, so this turn locks the contract on a copy. test_capability_responses_are_derived_from_router_registries walks the package and fails if a dict literal sets capabilities to a list, tuple, or set. The message says capability responses must derive from the router registry. The names in api.py are the two CapabilityModule arguments. test_environment_access_has_declared_owners allows os.getenv only in config.py and runtime.py.

Copy the empty list

Copy test_list_records_is_empty from tests/test_health.py. The retail nouns are the configuration. The check is that a fresh schema, read through the public route, is an empty list.

def test_list_records_is_empty(app_db_path) -> None:
    response = TestClient(create_app(db_path=app_db_path)).get("/v1/records")

    assert response.status_code == 200
    body = response.json()
    assert body["items"] == []
    assert body["items"] == list(body["items"])

AGENTS.md states the matching rule for a screen: empty lists are correct until a governed owner records rows, and invented records, metrics, catalog rows, or spend figures are out of bounds. BUSINESS_CONTEXT.md names the next slice as an owner-recorded trust assessment that binds one persisted policy to observed behavior and enforcement evidence and appears on GET /v1/records. Those policy models are the ones main does not have. The product has no write route. GET /v1/records is the ready path this build serves, and test_list_records_is_empty asserts that a fresh file returns items as [].

Close

The notebook is what tool use looks like when the instruction is to do what the caller asks and the prompt says not to wait for approval: issue_customer_refund appends 750000, and the stored pair is the success sentence plus that list. The served workflow returns versioned context and the register, and it does not call the notebook Agent. It will return customer-support-agent inside nova-electronics.v1, it will reject a /v1 call whose bearer does not match the configured token, and it will return items as [] while agent_trust_framework_record has no owner row. Record has no amount to store. The pre-SQLite policy rows stay in data/local-postgres/agent_trust_framework-20261013-premigration.dump until that branch is ported, which README leaves as an operator decision. An owner-recorded trust assessment belongs on GET /v1/records when governed host code has stored that row.

How is this page?

Last updated on