This guide covers testing procedures for AgentCore deployments in FSI Foundry.
Testing approaches:
- Automated test scripts — Comprehensive test suites per use case
- Manual API testing — Direct invocation via AWS CLI
- Control Plane testing — Test Deployment drawer in the web UI
- Local testing — Test agent logic without AWS deployment
Prerequisites: AWS CLI >= 2.28.9
./applications/fsi_foundry/scripts/use_cases/{USE_CASE_ID}/test/test_agentcore.shTest Coverage:
- Runtime status verification
- Full assessment (all agents)
- Partial assessments (individual agents)
- Invalid input handling
- Load test (5 concurrent requests)
Expected Results: All tests passing (100% success rate)
Sample Output:
========================================
AgentCore Runtime Test Script
========================================
Region: us-east-1
Step 1: Getting runtime details...
Runtime ARN: arn:aws:bedrock-agentcore:us-east-1:123456789012:runtime/...
========================================
Test 1: Full Assessment
========================================
✓ Full assessment PASSED
========================================
Test 2: Partial Assessment
========================================
✓ Partial assessment PASSED
========================================
Test 3: Invalid Input
========================================
✓ Invalid input handling PASSED
========================================
Test 4: Load Test (5 concurrent)
========================================
✓ Load test PASSED
========================================
Test Summary
========================================
Tests Passed: 4
Tests Failed: 0
Success Rate: 100%
All tests passed!
Performance Characteristics:
- First invocation (cold start): 10-30 seconds
- Subsequent invocations: ~15-55 seconds depending on assessment type
- Load test (5 concurrent): ~85 seconds
# From Terraform outputs
cd applications/fsi_foundry/foundations/iac/agentcore/runtime
RUNTIME_ARN=$(terraform output -raw agentcore_runtime_arn)PAYLOAD=$(echo -n '{"customer_id": "CUST001", "assessment_type": "full"}' | base64)
aws bedrock-agentcore invoke-agent-runtime \
--agent-runtime-arn ${RUNTIME_ARN} \
--payload "${PAYLOAD}" \
--region us-east-1 \
/tmp/response.json
cat /tmp/response.json | jq '.'The Control Plane UI provides a Test Deployment drawer for each deployed use case:
- Navigate to the deployment detail page
- Click Test Deployment
- Select a test entity and assessment type
- Click Run — the UI invokes the agent and displays the result
The drawer supports three modes:
- CLI — Run against the deployed runtime with selectable entity and type
- Script — Execute the full test script with streaming output
- Custom — Edit a JSON payload and invoke directly
Test the agent logic locally without deploying to AWS:
export DEPLOYMENT_MODE=local
export AWS_REGION=us-east-1
export BEDROCK_MODEL_ID=us.anthropic.claude-haiku-4-5-20251001-v1:0
export S3_BUCKET_NAME=your-bucket-name
export AWS_ACCESS_KEY_ID=your-key
export AWS_SECRET_ACCESS_KEY=your-secret
# Install dependencies
cd applications/fsi_foundry/foundations/src
pip install -r requirements/requirements.txt
# Run locally
python main.pyThe server starts on port 8000.
# Full assessment
curl -X POST http://localhost:8000/invoke \
-H "Content-Type: application/json" \
-d '{"customer_id": "CUST001", "assessment_type": "full"}'{
"assessment_id": "uuid-here",
"customer_id": "CUST001",
"assessment_type": "full",
"timestamp": "2026-01-30T12:00:00Z",
"credit_analysis": {
"risk_score": 75,
"rating": "MEDIUM_RISK",
"analysis": "Detailed credit analysis...",
"recommendations": ["Recommendation 1", "Recommendation 2"]
},
"compliance_check": {
"status": "COMPLIANT",
"kyc_status": "VERIFIED",
"analysis": "Detailed compliance analysis..."
},
"final_recommendation": {
"decision": "APPROVE",
"confidence": "HIGH",
"reasoning": "Detailed reasoning..."
}
}Possible causes:
- First invocation (cold start) — wait and retry
- Bedrock throttling — reduce concurrent requests
- Network issues — check AWS connectivity
Solution:
- Verify S3 bucket has sample data uploaded
- Check IAM permissions for S3 and Bedrock access
- Review CloudWatch logs for errors
Solution:
- Wait for container warm-up, then retry
- Check Bedrock rate limits
- Review AgentCore runtime logs in CloudWatch
| Metric | AgentCore |
|---|---|
| Cold start | +10-30s (first invocation only) |
| Partial assessment | ~15-16s |
| Full assessment | ~55s |
| Load test (5 concurrent) | ~85s |
Optimization Tips:
- Reduce
max_tokensin agent configurations - Use faster Bedrock models (e.g., Claude Haiku)
- Implement caching for repeated requests
- Accept cold start as trade-off for serverless auto-scaling
- Cleanup Guide — Remove deployed resources
- AgentCore Deployment Guide — Deployment instructions
- Architecture — AgentCore architecture design