Configuration and secrets
Configuration is split deliberately:
-
Secrets — credentials only. One Secrets Manager secret,
agentcore-configs, read once per container and cached. -
Environment variables — infrastructure wiring only: queue URLs, ARNs, tenant id, batch sizes, log level. Set by the SAM template or the CDK stack.
|
Agent configuration — model id, system prompt, provider, token limits — is never
an environment variable and never lives in CDK or SAM. It is code, in
|
The shared secret
Secrets Manager secret name agentcore-configs (created by the SAM template as
AgentcoreSecret, populated manually after the first deploy). It is a flat JSON
object; each consumer maps only the keys it needs and ignores the rest.
| Key | Consumers | Purpose |
|---|---|---|
|
all Lambdas |
PostgreSQL connection string with the |
|
scraper |
SmartScout account credentials used to obtain a session token. |
|
scraper |
Cached SmartScout session token. Written back to the secret by the scraper’s auth module — this is why the scraper has |
|
morpheus-hubspot |
Preferred HubSpot auth. A |
|
morpheus-hubspot, scorer, agentcore |
HubSpot OAuth fallback, and the credentials the HubSpot MCP tool needs. |
|
morpheus-hubspot |
|
|
scorer, agentcore |
Tavily Remote MCP web-search key used by the enrichment agent. |
|
agentcore |
Required by the runtime’s secret schema. Reserved for a future OpenAI provider. |
|
agentcore |
Optional. Not needed on Bedrock — the IAM role provides authentication. |
|
phone-agent |
Twilio Lookup v2 line-type intelligence. |
|
phone-agent |
Slack bot token for task reminders, DMs, and user lookup. Empty disables Slack work. |
|
scraper, morpheus-hubspot, phone-agent |
Google service-account JSON, as a string. Empty makes every BigQuery-backed handler log a warning and return. |
|
morpheus-hubspot |
Optional. Nooks Sequencing API, used by the dialer-call-ended sync. |
|
morpheus-hubspot |
Files.com key used to download Five9 call-log CSVs. |
|
Containers cache the secret for their lifetime ( |
Populating the secret
aws secretsmanager put-secret-value \
--secret-id agentcore-configs \
--region us-east-1 \
--secret-string '{
"DATABASE_URL": "postgresql://…:6543/postgres",
"HUBSPOT_PRIVATE_APP_TOKEN": "pat-na1-…",
"HUBSPOT_CLIENT_ID": "…",
"HUBSPOT_CLIENT_SECRET": "…",
"HUBSPOT_REFRESH_TOKEN": "…",
"TAVILY_API_KEY": "tvly-…",
"OPENAI_API_KEY": "sk-…",
"TWILIO_ACCOUNT_SID": "AC…",
"TWILIO_AUTH_TOKEN": "…",
"SLACK_BOT_TOKEN": "xoxb-…",
"BIGQUERY_CREDENTIALS": "{\"type\":\"service_account\", …}"
}'
Never commit a populated secret, a .env file, or a service-account JSON.
Lambda environment variables
Global defaults from Globals.Function.Environment in lambdas/template.yaml:
| Variable | Default | Purpose |
|---|---|---|
|
|
Root logger level, applied by each function’s |
|
|
Empty disables Sentry entirely. See Observability. |
|
|
Environment tag on Sentry events. |
Per function:
| Variable | Value |
|---|---|
|
|
|
ARN of |
|
|
|
|
Additional Settings fields with code defaults (override via environment if
needed): SMARTSCOUT_MARKETPLACE (US), ICP_REVENUE_MIN (100000),
ICP_REVENUE_MAX (1000000), ICP_CATEGORIES (empty, comma-separated),
MAX_PAGES_PER_RUN (1), PAGE_SIZE (10),
BIGQUERY_CONTACT_SYNC_BATCH_SIZE (1000).
|
|
| Variable | Value |
|---|---|
|
ARN of |
|
|
|
|
| Variable | Value |
|---|---|
|
ARN of |
|
|
|
|
Additional Settings fields with code defaults, overridable via environment:
HUBSPOT_TASK_POLL_BATCH_SIZE (100),
BIGQUERY_ENGAGEMENT_SYNC_BATCH_SIZE (1000),
FIVE9_CALL_SYNC_BATCH_SIZE (500).
| Variable | Value |
|---|---|
|
ARN of |
|
|
| Variable | Value |
|---|---|
|
ARN of |
|
|
|
|
|
|
|
|
|
|
AgentCore runtime environment variables
Injected by the CDK stack into CfnRuntime.environmentVariables:
| Variable | Value |
|---|---|
|
Stack region |
|
|
|
Memory resource id from |
|
Secrets Manager ARN, only when |
Optional runtime defaults read by agentcore/config/loader.py, all with code
defaults: DEFAULT_AGENT_PROVIDER (claude), DEFAULT_MODEL_ID,
DEFAULT_AGENT_NAME (AgentCore), DEFAULT_SYSTEM_PROMPT,
DEFAULT_MAX_TOKENS (4096), DEFAULT_MAX_TURNS (10), MAX_TOKENS (used by
constants.AGENT_MAX_TOKEN).
SECRET_ARN is mandatory — load_config() raises RuntimeError at import if it
is absent. See runtime configuration.
Configuration held in the database
Some state is neither a secret nor an environment variable — it is a row in the
configs table, so it survives cold starts and can be changed without a deploy.
configs.key |
Meaning |
|---|---|
|
|
|
Row offset where the next scheduled discovery run begins. |
|
Last |
|
Last |
|
Last processed Files.com file modification time for Five9 CSVs. |
|
Round-robin cursor for sales-rep assignment. |
Full detail: Runtime state in configs.