Skip to Content
Recodocs

Bedrock agents core

What does an offline bedrock-agents-core run prove about a managed agent?

7 min read

The set asks which host and SDK contracts for a managed Bedrock agent hold on recorded fixtures when AWS_LIVE is unset. Every notebook's persona is a platform engineer. The sequence covers a least-privilege role, an agent keyed by name plus configuration digest, an alias reused by exact name, a 128-token orchestration cap, a Lambda action group, an OpenAPI group that returns control to the host, prompt overrides with a guardrail reference, a knowledge-base metadata filter, a delete cascade with absence proofs, and a harness that checkpoints a failed answer.

Recorded responses prove SDK and host contracts. Notebooks 1, 2, 4, 5, 6, and 7 use botocore Stubber responses; notebook 8 uses only RecordedRuntimeClient streams. Notebooks 1, 2, 5, 6, 7, and 8 call the recorded route recorded and say it is not a capture of a real account. Notebooks 2, 3, 4, 6 and 7 also state live claims. Those claims are asserted only when AWS_LIVE=1. In the committed offline execution they are unvalidated.

How to run it

A recorded fixture can test how the host handles an expected service response. It cannot prove that a live cloud account is configured correctly; the notebook separates those kinds of evidence.

Use .venv-bedrock-agents-core and the bedrock-agents-core kernel from the kit root. Install the local kit and packages/bedrock-agents, plus nbconvert, ipykernel, pandas and ruff. docs/bedrock-agents-core/versions.json records the actual environment.

Run in table order with the agentcore-set-run runner and --no-cleanup-on-stop. The last notebook is not a dedicated cloud-cleanup entry point. Outputs and attempts stay under docs/bedrock-agents-core. For offline execution, leave AWS_LIVE unset.

agentcore-set-run --no-cleanup-on-stop

Recorded fixtures use dummy credentials and do not access AWS. Live cells require AWS_LIVE=1, an explicit recohut profile, us-east-1, and the bounded allocation in docs/aws-live-plan.md. Live creation uses finally cleanup and service absence checks. A missing knowledge base or an unavailable model stays unverified. Do not rerun live cells without accounting for retained receipts.

The original live lifecycle output of notebook 2 is preserved under docs/bedrock-agents-core/attempts/. The executed notebooks in this directory are offline runs: recorded lanes asserted, live lanes not run, and those files do not contain live evidence. Observed outcomes, skipped live paths and cleanup limits are in docs/bedrock-agents-core/bedrock-agents-core-verification.md.

Notebooks 1–4 say to run from the kit root; every notebook says to create .runtime/<stem>/ and delete it in the last cell. Recorded identifiers are synthetic, and account 000000000000 is masked on output. Every README row has browser checkpoint none: a backend notebook.

Notebooks

NotebookWhat it doesRecorded output
01-create-agent-recorded.ipynbensure_role, ensure_agent, prepare and ensure_alias on a Stubber. Cap: 0 AWS calls, 0 model calls.yes
02-lifecycle-live-nova-micro.ipynbSame lifecycle on amazon.nova-micro-v1:0 with an ORCHESTRATION maximumLength of 128, then one recorded InvokeAgent. Live claims need AWS_LIVE=1. Cap: at most 1 InvokeAgent here, 4 for the set, 128 output tokens per orchestration model call.yes
03-lambda-action-group.ipynbPackages handlers/order_status.py, ensures a 128 MB Lambda, grants one agent ARN, and attaches a function-definition action group. Live model choice only when AWS_LIVE=1.yes
04-openapi-action-group.ipynbTurns two host tools into one OpenAPI 3.0 document and uses return of control. The same document is a read; a changed description is one update. Live claims only when AWS_LIVE=1.yes
05-prompt-override-guardrail.ipynbORCHESTRATION override with parserMode: OVERRIDDEN, a parser Lambda, a knowledge-base answer override, and a GuardrailRef. Recorded only: 0 AWS calls, 0 model calls. No guardrail is created live in this set.yes
06-knowledge-base-filter.ipynbAssociates a knowledge base once and builds one andAll metadata filter. Live work is one read-only ListKnowledgeBases when AWS_LIVE=1. Cap: 0 InvokeAgent, 0 model calls.yes
07-delete-cascade-absence.ipynbRemoves alias, collaborator, action group, knowledge-base association and a Lambda permission before DeleteAgent, then proves absence. Live cascade only when AWS_LIVE=1. Cap: 0 InvokeAgent, 0 model calls.yes
08-harness-checkpoint-resume.ipynbBedrockAgentHarness over a recorded runtime and a RunStore: a repairable answer, a simulated crash, then resume. Cap: 0 AWS calls, 0 model calls.yes

What the recorded outputs show

Notebook 1 prints role rk-bac-01-agent-role, 'created': True, 'updated': False, policy digest dd698d7b5e0f23d342a13b0f4f8be13a2a6b6fb273de03c45dac6b2f08863edf, and an inline policy of bedrock:InvokeModel plus bedrock:InvokeModelWithResponseStream on arn:<bedrock>. Reuse prints IAM writes during reuse: 0. Agent AGENT00001 (rk-bac-01-orders) is created NOT_PREPARED, then reused with digest abd657f65a0d87ba24c9d1251e0c93f5afe3d51ce90af7f7678dfb4c24eba0f6 and status PREPARED. Counters are CreateAgent calls: 1 and UpdateAgent calls: 0. prepare prints PREPARED. Alias live (ALIAS00001) is created, then reused. The notebook says that status change is the scripted readback.

Notebook 2 prints digest changed: True | updated: True and an ORCHESTRATION override with "maximumLength": 128, "promptCreationMode": "OVERRIDDEN", and placeholder <default template from GetAgent>. The invoke prints recorded trajectory: completed | Hello., UsageSummary(model_calls=4, input_tokens=750, output_tokens=115), and all stubbed responses consumed: True. The notebook calls that stream synthetic. The live gate prints live lane will run: False.

Notebook 3 prints a TEXT body for ORD-1001 with "status": "shipped", "carrier": "Northwind Freight" and "eta": "2026-10-22". ORD-9 prints unknown order: FAILURE. Packaging prints zip bytes: 1320 | stable CodeSha256: True. Function rk-bac-03-order-status has code_sha256 BfREiMoavz3Gp8eC9uWegkkvz7kq/frOVBQkZ7XYdNw=, 'created': True, 'updated': False, and permission added: True.

Notebook 4 prints OpenAPI tool definitions ready. and a POST whose "operationId" is get_order_status, with required string order_id. The notebook lists paths ['/get_order_status', '/list_orders_by_status']. Ensure prints first: created=True updated=False, same document: created=False updated=False, changed: created=False updated=True, and all stubbed responses consumed: True. A fixture prints Synthetic OpenAPI ROC payload ready: /get_order_status.

Notebook 5 prints the synthetic template, "parserMode": "OVERRIDDEN", stop sequences </invoke>, </answer> and </error>, maximumLength 2048, temperature 0.0, topK 250, topP 1.0, and digest prefixes cd7b8c776d and 9e9ed1259d. Three attempts print refusals: a parser with no Lambda, two parser Lambdas, and a duplicate prompt type. The update prints created: True | updated on digest change: True, UpdateAgent carried promptOverrideConfiguration: True, and UpdateAgent calls: 1. The model id is mistral.mistral-large-2407-v1:0.

Notebook 6 prints knowledge bases in the account: None and lane for association: recorded only. Association prints first wrote: True | second wrote: False and Associate calls: 1. The wire uses KBRECORD01, an andAll of region north and year 2025, "numberOfResults": 3 and "overrideSearchType": "HYBRID". The notebook says the two builders match, and that a one-child andAll, operator near, and an equals leaf without value are refused.

Notebook 7 prints one delete_agent, plus one delete or disassociate for the alias, collaborator, action group, and knowledge base, plus one lambda.remove_permission. Absence rows show "absent": true for the agent (id_sha256 b8cb059a0e, get_agent:ResourceNotFoundException, list_agents:absent), the function (254a5d1d1c, get_function:ResourceNotFoundException) and a role (ad8cc7a893, get_role:NoSuchEntity). The notebook says every proof is absent and the stubber queue is drained. The live gate prints live lane will run: False.

Notebook 8 records 9 outputs. The listing includes Definitions ready: verify, Definitions ready: build, after invoke: continue | after verify: continue, candidate Order ORD-1001 is on its way., and worker-a objects discarded (simulated crash, lease still held). Limits in the notebook are max_invocations=4, max_repairs=1 and lease_seconds=2.0. The agent ref uses amazon.nova-micro-v1:0.

What is not shown or not run

Every notebook has recorded output. None is marked as not run in the saved file. Live lanes in the saved files were not run.

Notebook 2's live gate prints live lane will run: False. The baseline count, the InvokeAgent counter and live_lifecycle have no print here. The retained live file named in the notebook is attempts/02-lifecycle-live-nova-micro.original-live.ipynb. The README says these executed notebooks contain no live evidence.

Notebook 3 states a live InvokeAgent, cleanup and a zero tagged inventory, and says the offline run does not exercise them. Its second ensure_function line ends at 'crea, and no output follows the recorded Lambda trace. Notebook 4 claims no live model-selected OpenAPI journey; run_host_call stops before a result. Notebook 6 leaves the count None (ListKnowledgeBases did not run) and says a planning note of 0 was not re-read. Its invoke stops at add_stream. Notebook 7's live cascade has no output, so the prefix sweep and tagged inventory of 0 stay unvalidated. The receipt print omits cascade order.

Notebook 5 creates no live guardrail. Notebook 8's opening says a new owner is refused while the lease is live, then resume keeps the session id, memory id and history, the repaired answer passes, and the run is completed. The listing stops at the crash note, so those later lines are absent from it. The notebook calls this a recorded trajectory. Hello. and the usage summary are synthetic InvokeAgent fixture fields; the shipped-order JSON is the local lambda_handler return for ORD-1001.

Where it fits in the kit

The notebooks import these modules:

  • recohut_kit.runtime (Fault)
  • recohut_kit.harness.contracts (Binding, Conflict, Scope, Task, Verification)
  • recohut_kit.harness.state (RunStore)
  • recohut_kit_bedrock_agents.recorded
  • recohut_kit_bedrock_agents.recorded_runtime
  • recohut_kit_bedrock_agents.events (ModelInvocationEvent, ActionInvocationEvent)
  • recohut_kit_bedrock_agents.invoke (AgentRuntime, parse_completion, RocResult, KnowledgeBaseConfig, SessionState)
  • recohut_kit_bedrock_agents.service (PromptOverride, GuardrailRef, kb_retrieval_config, LAMBDA_BASIC_EXECUTION, AgentDefinition)
  • recohut_kit_bedrock_agents.action_groups (ActionGroupSpec, LambdaExecutor, LambdaPackager, ensure_action_group, OpenApiSchema, ReturnControl, openapi_from_tools)
  • recohut_kit_bedrock_agents.schemas (FunctionSpec, ParameterSpec, tool_from_function)
  • recohut_kit_bedrock_agents.contracts (ReceiptLog)
  • recohut_kit_bedrock_agents.harness (AgentRef, BedrockAgentHarness, HarnessLimits)

They also import bac_support, handlers.order_status and boto3.

How is this page?

Last updated on