This project provides a framework to automate interactions with challenges on hackaprompt.com. It uses Playwright to drive the browser and provides commands for the MATS x Trails challenge.
-
Install Dependencies:
pip install -r requirements.txt playwright install --with-deps
-
Configure:
- Copy
template.config.yamltoconfig.yaml. - Edit
config.yamlto set your desired challenge URL and selectors.
- Copy
-
Run:
- Connect to an existing browser instance by launching Brave/Chrome with remote debugging:
brave-browser-beta --remote-debugging-port=9222
- Run one of the commands below.
- Connect to an existing browser instance by launching Brave/Chrome with remote debugging:
Download Brave Beta from the official website: https://brave.com/download-beta/
brave-browser-beta --remote-debugging-port=9222This command fills the intent textarea, clicks the Submit Template button, and then automatically clicks the Try Again button until max_retries is reached (from config.yaml). Provide your own text via --text. Optionally specify a model to select from the dropdown via --model.
python -m src.app agent-track-submit-retry --text "Hello from agent"
python -m src.app agent-track-submit-retry --text "Hello from agent" --model "fair river"Available models: fair river, gentle window, optimistic bird, dazzling stream, happy echo, yellow mountain
Use --launch-browser if you want the script to launch a fresh browser instance instead of connecting to one that is already running.
brave-browser-beta --remote-debugging-port=9222If you need to launch a new browser instead of connecting to an existing one, add the --launch-browser flag to any of the commands above:
python -m src.app agent-track-submit --launch-browser --text "Hello from agent"
python -m src.app agent-track-submit-retry --launch-browser --text "Hello from agent"For more detailed information on configuration, development, and the project's architecture, please see the docs directory.
For older challenge functions (run, judge, run-intent), see the src/challenge_executor/core/cbrne/README.md file.
Important: Real configuration files containing your specific settings are not committed to git for security reasons. You must create your own config file from the provided templates.
-
Main Configuration: Copy the template to create your main config:
cp template.config.yaml config.yaml
-
Challenge-Specific Configs: Copy challenge-specific templates as needed:
# For MATS x Trails challenge cp src/challenge_executor/core/mats_x_trails/template.config.yaml src/challenge_executor/core/mats_x_trails/config.yaml # For CBRNE challenge cp src/challenge_executor/core/cbrne/template.config.yaml src/challenge_executor/core/cbrne/config.yaml
-
Edit Your Config: Modify the copied config files with your specific:
- Challenge URLs
- CSS selectors
- Timeout values
- Browser settings
- Custom prompts
- Template files (committed to git):
template.config.yamlin each directory - Real config files (gitignored):
config.yamlin each directory
Each directory containing a config file has its own .gitignore file that excludes the real config.yaml while allowing the template.config.yaml to be committed. This ensures that:
- Sensitive configuration data is never accidentally committed
- Templates provide examples and starting points
- Users can customize their setup without affecting others
- Each challenge module manages its own configuration independently