- Docker Desktop installed and running
- Python 3.12+ installed
- Temporal Server running (either locally or accessible)
cd agents/red-cell
# Build the image
docker build -t red-cell:local .# Run with environment variables
docker run -it --rm \
--name red-cell-worker \
-p 8000:8000 \
-e AGENT_NAME="red-cell" \
-e WORKFLOW_NAME="RedCellWorkflow" \
-e WORKFLOW_TASK_QUEUE="red-cell-queue" \
-e TEMPORAL_ADDRESS="host.docker.internal:7233" \
-e TEMPORAL_NAMESPACE="default" \
-e LITELLM_API_KEY="your-litellm-api-key" \
-e AGENTEX_BASE_URL="http://host.docker.internal:5003" \
-e AGENT_API_KEY="your-agent-api-key" \
-e OPENAI_API_KEY="your-openai-api-key" \
red-cell:localNote: On Mac, use host.docker.internal to access services running on your host machine.
Check the logs - you should see:
Starting Temporal worker...
Worker started successfully
Listening on task queue: red-cell-queue
version: '3.8'
services:
red-cell-worker:
build: .
container_name: red-cell-worker
ports:
- "8000:8000"
environment:
- AGENT_NAME=red-cell
- WORKFLOW_NAME=RedCellWorkflow
- WORKFLOW_TASK_QUEUE=red-cell-queue
- TEMPORAL_ADDRESS=host.docker.internal:7233
- TEMPORAL_NAMESPACE=default
- LITELLM_API_KEY=${LITELLM_API_KEY}
- AGENTEX_BASE_URL=http://host.docker.internal:5003
- AGENT_API_KEY=${AGENT_API_KEY}
- OPENAI_API_KEY=${OPENAI_API_KEY}
restart: unless-stopped# .env
LITELLM_API_KEY=your-litellm-api-key
AGENT_API_KEY=your-agent-api-key
OPENAI_API_KEY=your-openai-api-key# Start the worker
docker-compose up -d
# View logs
docker-compose logs -f
# Stop the worker
docker-compose downcd agents/red-cell
# Create virtual environment
python3 -m venv venv
# Activate it
source venv/bin/activate # On Mac/Linux# Install the package in development mode
pip install -e .
# Or install from requirements
pip install -r requirements.txtexport AGENT_NAME="red-cell"
export WORKFLOW_NAME="RedCellWorkflow"
export WORKFLOW_TASK_QUEUE="red-cell-queue"
export TEMPORAL_ADDRESS="localhost:7233"
export TEMPORAL_NAMESPACE="default"
export LITELLM_API_KEY="your-litellm-api-key"
export AGENTEX_BASE_URL="http://localhost:5003"
export AGENT_API_KEY="your-agent-api-key"
export OPENAI_API_KEY="your-openai-api-key"# Run the worker
python -m project.workerIf you don't have Temporal running, you can start it with Docker:
# Run Temporal server
docker run -d \
--name temporal \
-p 7233:7233 \
-p 8233:8233 \
temporalio/auto-setup:latest
# Run Temporal UI (optional)
docker run -d \
--name temporal-ui \
-p 8080:8080 \
--link temporal:temporal \
-e TEMPORAL_ADDRESS=temporal:7233 \
temporalio/ui:latestAccess Temporal UI at: http://localhost:8080
If you want to connect to a remote Temporal cluster:
# Port forward Temporal
kubectl port-forward -n agentex svc/agentex-temporal-frontend 7233:7233
# Port forward AgentEx
kubectl port-forward -n agentex svc/agentex 5003:5003Then run the worker with:
docker run -it --rm \
--name red-cell-worker \
-p 8000:8000 \
-e TEMPORAL_ADDRESS="host.docker.internal:7233" \
-e AGENTEX_BASE_URL="http://host.docker.internal:5003" \
# ... other env vars
red-cell:local- Navigate to http://localhost:8080 (or your Temporal UI)
- Go to "Workflows"
- Click "Start Workflow"
- Select workflow type:
RedCellWorkflow - Task queue:
red-cell-queue - Input:
{
"task": {
"id": "test-task-001"
}
}# Create a task
curl -X POST http://localhost:5003/api/tasks \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-agent-api-key" \
-d '{
"agent_name": "red-cell",
"input": {
"target_scope": {
"domains": ["example.com"],
"ip_ranges": [],
"rules_of_engagement": "Testing only"
},
"scan_type": "light"
}
}'Edit files in agents/red-cell/project/
docker build -t red-cell:local .# If using docker run
docker stop red-cell-worker
docker run -it --rm ... red-cell:local
# If using docker-compose
docker-compose restart# Docker run
docker logs -f red-cell-worker
# Docker compose
docker-compose logs -f
# Python direct
# Logs will appear in terminalAdd to environment variables:
-e LOG_LEVEL="DEBUG"
-e PYTHONUNBUFFERED="1"# Start container with shell
docker run -it --rm \
--entrypoint /bin/bash \
red-cell:local
# Then manually run the worker
python -m project.worker# List running containers
docker ps
# Inspect container
docker inspect red-cell-worker
# Check resource usage
docker stats red-cell-workerSolution: Make sure Temporal is running and accessible:
# Test connection
nc -zv localhost 7233
# Or from inside container
docker exec -it red-cell-worker nc -zv host.docker.internal 7233Solution: Rebuild the Docker image:
docker build --no-cache -t red-cell:local .Solution: Stop the conflicting container:
docker ps
docker stop <container-id>Solution: Check they're passed correctly:
docker exec -it red-cell-worker env | grep AGENT_NAMEdocker build -t red-cell:local .docker run -it --rm \
--name red-cell-worker \
-p 8000:8000 \
-e TEMPORAL_ADDRESS="host.docker.internal:7233" \
-e OPENAI_API_KEY="your-key" \
red-cell:localdocker logs -f red-cell-workerdocker stop red-cell-worker# Remove container
docker rm red-cell-worker
# Remove image
docker rmi red-cell:local
# Remove all stopped containers
docker container prune- ✅ Get the worker running locally
- ✅ Test with a simple workflow
- ✅ Verify agents are working
- 🔄 Implement remaining workflow states
- 🔄 Add tool call visualization
- 🔄 Test end-to-end multi-agent flow
For issues or questions:
- Check logs:
docker logs -f red-cell-worker - Verify Temporal connection:
nc -zv localhost 7233 - Check environment variables:
docker exec red-cell-worker env - Review Temporal UI: http://localhost:8080