Description
agentcore invoke currently requires the harness to be defined in the local project's agentcore.json and deployed through the CLI. There is no way to invoke a harness that was created through the AWS Console, AWS CLI, SDK, or another AgentCore CLI project.
Current Behavior
The invoke flow in src/cli/commands/invoke/action.ts (lines ~515-557) strictly requires:
- Local project context: Harness must exist in
project.harnesses array from agentcore.json
- CLI-deployed state: Harness must appear in
deployedState.targets[target].resources.harnesses[name]
- Name-based lookup only: The
--harness <name> flag only accepts local harness names, not ARNs or external identifiers
If no harnesses are found in the local config, the error is: "No harnesses defined in configuration". If the harness isn't in deployed state, the error is: "Harness '<name>' is not deployed to target '<target>'. Run 'agentcore deploy' first."
There is no --harness-arn, --harness-id, or similar flag to reference an externally-managed harness.
Expected Behavior
Users should be able to invoke any harness they have access to, regardless of how it was created:
# Invoke by ARN (harness created outside the CLI)
agentcore invoke --harness-arn arn:aws:bedrock-agentcore:us-east-1:123456789012:harness/my-harness
# Invoke by name with explicit region/account (no local project needed)
agentcore invoke --harness-name my-harness --region us-east-1
Proposed Approach
- Add
--harness-arn flag to the invoke command that bypasses local project lookup
- When an ARN is provided, directly invoke the harness via the AgentCore API without requiring local project context or deployed state
- Optionally support
--harness-name + --region as a convenience (construct the ARN automatically)
- Maintain backwards compatibility: existing
--harness <name> behavior for local project harnesses should remain unchanged
Use Cases
- Team collaboration: Developer A creates a harness, Developer B wants to test it without cloning the project
- Console-created harnesses: Users who create harnesses in the AWS Console should be able to invoke them from the CLI
- Cross-project invocation: Invoking a harness from a different AgentCore project
- CI/CD pipelines: Automated testing of harnesses by ARN without maintaining a full project checkout
Impact
This limitation forces all harness consumers to use the exact same CLI project that created the harness. It breaks common team workflows and creates unnecessary coupling between harness creation and invocation.
Description
agentcore invokecurrently requires the harness to be defined in the local project'sagentcore.jsonand deployed through the CLI. There is no way to invoke a harness that was created through the AWS Console, AWS CLI, SDK, or another AgentCore CLI project.Current Behavior
The invoke flow in
src/cli/commands/invoke/action.ts(lines ~515-557) strictly requires:project.harnessesarray fromagentcore.jsondeployedState.targets[target].resources.harnesses[name]--harness <name>flag only accepts local harness names, not ARNs or external identifiersIf no harnesses are found in the local config, the error is:
"No harnesses defined in configuration". If the harness isn't in deployed state, the error is:"Harness '<name>' is not deployed to target '<target>'. Run 'agentcore deploy' first."There is no
--harness-arn,--harness-id, or similar flag to reference an externally-managed harness.Expected Behavior
Users should be able to invoke any harness they have access to, regardless of how it was created:
Proposed Approach
--harness-arnflag to the invoke command that bypasses local project lookup--harness-name+--regionas a convenience (construct the ARN automatically)--harness <name>behavior for local project harnesses should remain unchangedUse Cases
Impact
This limitation forces all harness consumers to use the exact same CLI project that created the harness. It breaks common team workflows and creates unnecessary coupling between harness creation and invocation.