Autonomous mystery shopper for mobile/web signup flow testing
Sherlock is an AI-powered testing system that simulates real user behavior to test signup flows, detect friction points, diagnose root causes, and escalate issues via Slack alerts.
📊 View Test Dashboards: Check out the Sherlock Website to view run history, visualize test results, and explore insights from your Sherlock tests in a beautiful web interface.
- AI-Driven Navigation: Uses AWS Bedrock to make intelligent decisions during signup flows
- Persona-Based Testing: Test with different user profiles (impatient, confused, careful users)
- Mobile Emulation: Full Playwright-based mobile device simulation with network throttling
- Automated Diagnosis: Classifies failures by root cause (Backend, UX/Content, Performance, Integration)
- Evidence Collection: Screenshots, traces, and detailed observation logs for every run
- Slack Integration: Real-time alerts with severity classification (P0-P3)
- Supabase Storage: Optional cloud storage for artifacts and run history
- Python 3.11 or higher
- AWS account with Bedrock access
- Playwright browsers (installed automatically)
pip install sherlock
playwright installgit clone <repository-url>
cd sherlock
pip install -e .
playwright installpip install sherlock-0.1.0-py3-none-any.whl
playwright installSherlock requires AWS credentials for Bedrock access. Choose one of these methods:
# Configure AWS CLI
aws configure --profile sherlock
# Enter your credentials when prompted
# Then create .env file:
echo "AWS_PROFILE=sherlock" > .envexport AWS_ACCESS_KEY_ID=AKIA...
export AWS_SECRET_ACCESS_KEY=...
export AWS_DEFAULT_REGION=us-west-2# Create .env file (never commit this!)
cat > .env << EOF
AWS_ACCESS_KEY_ID=AKIA...
AWS_SECRET_ACCESS_KEY=...
AWS_DEFAULT_REGION=us-west-2
EOFsherlock preflightFor demo setup, use the included script:
./setup_demo.shsherlock initThis interactive setup will configure:
- Primary staging URL
- Allowed domains (security allowlist)
- AWS Bedrock region/model
- Slack webhook (optional)
- Default persona and device settings
sherlock run --goal "Complete signup with document upload" \
--persona impatient_user \
--device "iPhone 13" \
--network 3g# View latest run report
sherlock report
# View specific run
sherlock report run_20260207_134429_45c8c7ecCreate a .env file in your project directory:
# AWS Credentials
AWS_PROFILE=sherlock
# Or use explicit credentials:
# AWS_ACCESS_KEY_ID=AKIA...
# AWS_SECRET_ACCESS_KEY=...
# AWS Region
AWS_DEFAULT_REGION=us-west-2
# Bedrock Configuration
BEDROCK_MODEL_ID=nvidia.nemotron-nano-12b-v2
BEDROCK_REGION=us-west-2
# Security
SHERLOCK_ALLOWED_DOMAINS=staging.example.com,test.example.com
SHERLOCK_MAX_RUN_DURATION=300
# Slack Integration (Optional)
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/WEBHOOK/URL
# Supabase Integration (Optional)
SUPABASE_ENABLED=true
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your-anon-keySee .env.example for all available configuration options.
sherlock run --goal "Complete account creation"sherlock run --persona confused_first_time_user \
--goal "Sign up and verify email"sherlock run --device "iPhone 14" \
--network 3g \
--goal "Complete onboarding"sherlock run --url https://staging.acme.com/signup \
--goal "Complete signup form"sherlock run --goal "Complete signup" --headedSherlock includes built-in personas that shape testing behavior:
- confused_first_time_user: Explores more, hesitates, may misinterpret copy
- impatient_user: Low tolerance for delays, early abandonment risk
- careful_user: Reads labels thoroughly, validates before submit
- power_user: Experienced, expects efficiency
sherlock personas addThis launches an LLM-assisted builder that helps you create personas from natural language descriptions.
sherlock personas listInitialize configuration interactively
Execute autonomous test run
--goal(required): Test objective--persona: User behavior profile--url: Override starting URL--device: Device profile (e.g., "iPhone 13")--network: Network throttling (4g, 3g, slow3g)--headless/--headed: Browser visibility--max-steps: Override step limit
Display test run results and artifacts
Manage user personas
add: Create new personalist: Show all personasshow <name>: Display persona details
Validate Slack webhook configuration
Run deterministic demo mode with known failure paths
Validate AWS/Bedrock setup
Sherlock uses a modular monolith architecture:
CLI → Run Orchestrator → Agent Service (Bedrock)
→ Execution Worker (Playwright)
→ Diagnosis Engine
→ Alert Service (Slack)
Key Principles:
- Agent Service returns decisions only (no direct browser control)
- Run Orchestrator maintains state machine authority
- Execution Worker owns Playwright session lifecycle
- Guardrails prevent infinite loops (max steps, retries, timeouts)
Each run generates:
- Screenshots: Step-by-step visual evidence
- Trace files: Full Playwright execution trace
- Observations: Browser state at each step
- Agent reasoning: Decision-making timeline
- Persona review: User experience narrative
- Report: Run summary with metrics
Artifacts are stored in artifacts/<run_id>/
Sherlock classifies failures by:
Root Cause:
- Backend (server errors, API failures)
- UX/Content (confusing copy, unclear labels)
- Performance (timeouts, slow responses)
- Integration (third-party failures)
Severity:
- P0: Blocking signup completion
- P1: Major friction, likely abandonment
- P2: Noticeable issue, workaround exists
- P3: Minor UX annoyance
When enabled, Sherlock posts rich alerts with:
- Severity indicator
- Root cause classification
- Evidence links
- Reproduction steps
- Owner tags for routing
- Domain Allowlist: Prevents accidental production testing
- PII Redaction: Sanitizes logs
- Action Whitelist: Limits risky autonomous actions
- Timeout Guardrails: Hard limits on run duration
pip install -e ".[dev]"pytest tests/python -m buildContributions welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Submit a pull request
[Specify your license here - e.g., MIT, Apache 2.0]
- GitHub Issues: [repository-url]/issues
- Documentation: [docs-url]
- Real device testing (Appium/BrowserStack)
- Multi-locale support
- CI/CD integration
- Multi-agent orchestration
- Hosted dashboard for team triage
Built with AWS Bedrock, Playwright, and Python.