Agent Configuration
The agent service is configured via environment variables, loaded and validated in internal/config/config.go.
Required environment variables
Section titled “Required environment variables”| Variable | Description |
|---|---|
SLACK_BOT_TOKEN | Slack bot OAuth token (xoxb-...) |
SLACK_SIGNING_SECRET | Slack app signing secret for webhook verification |
JIRA_BASE_URL | Jira instance URL (e.g., https://fetchrewards.atlassian.net) |
JIRA_EMAIL | Jira account email for API authentication |
JIRA_API_TOKEN | Jira API token (paired with email for basic auth) |
GITHUB_APP_ID | GitHub App ID |
GITHUB_APP_INSTALLATION_ID | GitHub App installation ID |
GITHUB_APP_PRIVATE_KEY | GitHub App private key (PEM format) |
SOURCEGRAPH_TOKEN | Sourcegraph API token for code search MCP |
AGENT_BASE_URL | Public URL of the agent service (for callbacks) |
ENVIRONMENT | local or production identifier |
Optional environment variables
Section titled “Optional environment variables”| Variable | Default | Description |
|---|---|---|
PORT | 8080 | HTTP server port |
LOG_LEVEL | info | Structured log level |
JIRA_PROJECT | ADT | Default Jira project key for ticket creation |
JIRA_WEBHOOK_SECRET | — | Secret for verifying Jira webhook payloads |
JIRA_ACCOUNT_ID | — | Jira account ID for ticket assignment |
GITHUB_ORG | fetch-rewards | Default GitHub organization |
GITHUB_WEBHOOK_SECRET | — | Secret for GitHub App webhook signatures |
BEDROCK_MODEL_ID | us.anthropic.claude-sonnet-4-20250514-v1:0 | AWS Bedrock model ID |
AWS_REGION | us-east-1 | AWS region for Bedrock |
POSTHOG_PROJECT_API_KEY | — | Enables LLM analytics and error tracking |
POSTHOG_PROJECT_ID | — | Enables /debug command trace URLs |
SLACK_FEED_CHANNEL_ID | — | Channel for post_to_feed tool |
S3_IMAGE_BUCKET | — | S3 bucket for re-hosting images |
CLOUDFRONT_DOMAIN | — | CloudFront domain for permanent image URLs |
DATABASE_HOST | — | PostgreSQL host (omit for in-memory sessions) |
DATABASE_PORT | 5432 | PostgreSQL port |
DATABASE_NAME | agent_sessions | PostgreSQL database name |
DATABASE_USER | postgres | PostgreSQL user |
DATABASE_PASSWORD | — | PostgreSQL password |
DATABASE_PASSWORD_SECRET_NAME | — | AWS Secrets Manager name (alternative to DATABASE_PASSWORD) |
Local development
Section titled “Local development”cd agentcp .env.example .env # fill in valuesmake runFor database sessions locally, start PostgreSQL with Docker:
cd agentdocker compose up -dWhen DATABASE_HOST is unset, the agent falls back to InMemorySessionService — sessions are lost on restart but no database is needed.
Deployment
Section titled “Deployment”The agent is deployed to ECS via FSD config at agent/ad-tools-agent.yml. The deployment config defines:
- ECR repository:
ad-tools-agent - Environment variables: Plain values in
environment_variables - Secrets: Sensitive values from AWS Secrets Manager in
secrets - IAM policy:
bedrock:InvokeModelon Claude models - Dependencies: Aurora PostgreSQL database, S3 image bucket, CloudFront distribution
Stage/prod-specific values are configured in the variables section of the FSD config.