Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
161 commits
Select commit Hold shift + click to select a range
0d10970
Add run_initializers_async, Entra auth, and config-file support
romanlutz Feb 28, 2026
a9993ab
Expand memory interface and models for attack results
romanlutz Feb 28, 2026
792dc8c
Merge branch 'romanlutz/memory-models-expansion' into romanlutz/backe…
romanlutz Feb 28, 2026
3cfc605
Add attack-centric backend API with conversations and streaming
romanlutz Feb 28, 2026
65a4182
Frontend attack view with conversations, history, labels, and config
romanlutz Feb 28, 2026
f6db5bf
Merge remote-tracking branch 'origin/main' into romanlutz/frontend_at…
romanlutz Mar 2, 2026
0aff59d
fix: auto-fixed ruff format issues
romanlutz Mar 2, 2026
c27f2be
fix: address ruff and mypy lint issues
romanlutz Mar 2, 2026
c16196d
fix: remove unused type: ignore comments, ruff format
romanlutz Mar 2, 2026
c08b76f
Merge remote-tracking branch 'origin/main' into romanlutz/backend-att…
romanlutz Mar 2, 2026
0a4280d
fix: auto ruff format fixes
romanlutz Mar 2, 2026
96d5839
fix: address ruff and mypy lint issues
romanlutz Mar 2, 2026
14fb53f
fix: ruff format
romanlutz Mar 2, 2026
ad31d5b
fix: resolve merge conflicts, align service->memory naming
romanlutz Mar 3, 2026
f8950ff
fix: E731 lambda, E501 line length, service->memory naming
romanlutz Mar 3, 2026
4e4c247
Merge remote-tracking branch 'origin/main' into romanlutz/frontend_at…
romanlutz Mar 3, 2026
84f2c9d
Merge remote-tracking branch 'origin/main' into romanlutz/backend-att…
romanlutz Mar 3, 2026
14168cc
Merge remote-tracking branch 'origin/main' into romanlutz/frontend_at…
romanlutz Mar 3, 2026
4440cfd
Merge remote-tracking branch 'origin/main' into romanlutz/backend-att…
romanlutz Mar 3, 2026
484fcb9
fix: address copilot comments - imports, API contract, security, acce…
romanlutz Mar 3, 2026
b48e23f
fix: address copilot comments - security, cleanup, API contract
romanlutz Mar 3, 2026
8c8d4aa
Merge remote-tracking branch 'origin/main' into romanlutz/frontend_at…
romanlutz Mar 3, 2026
6bd4737
Merge remote-tracking branch 'origin/main' into romanlutz/backend-att…
romanlutz Mar 3, 2026
fe500fc
Fix mypy: pass datetime directly instead of isoformat string
romanlutz Mar 3, 2026
2e5d4c3
Merge remote-tracking branch 'origin/main' into romanlutz/backend-att…
romanlutz Mar 4, 2026
7770b52
Merge remote-tracking branch 'romanlutz/romanlutz/backend-attack-api'…
romanlutz Mar 4, 2026
421d4a9
Use TargetCapabilities for supports_multi_turn in backend API
romanlutz Mar 4, 2026
2949d05
Revert run_initializers_async extraction, use double initialize_pyrit…
romanlutz Mar 4, 2026
8324f50
Address PR review comments: quick fixes
romanlutz Mar 4, 2026
b3670dc
Move video remix injection logic from AttackService to OpenAIVideoTarget
romanlutz Mar 4, 2026
dd8d719
Address remaining review comments: UTC datetimes, persist guard, docs
romanlutz Mar 5, 2026
8bcbda8
Fix change_main_conversation to move old main to PRUNED not ADVERSARIAL
romanlutz Mar 5, 2026
2e15aef
Validate target_conversation_id belongs to attack in add_message_async
romanlutz Mar 5, 2026
f2c40c3
Persist updated_at in change_main_conversation_async
romanlutz Mar 5, 2026
7155dd0
Add comment explaining HTTPS-only check for Azure Blob URLs
romanlutz Mar 5, 2026
2c646a0
Add score_type and score_category to Score DTO, support true_false sc…
romanlutz Mar 5, 2026
838c34d
Replace 'stamp on' wording with 'attach to' for labels
romanlutz Mar 5, 2026
635ac23
Clarify converter_types filter description: omit = no restriction
romanlutz Mar 5, 2026
05cc65a
Clarify pagination cursor description in list_attacks route
romanlutz Mar 5, 2026
c5e25d9
Add explicit parens for attack_specific_params ternary clarity
romanlutz Mar 5, 2026
5adeb07
Validate source_conversation_id in create_related_conversation_async
romanlutz Mar 5, 2026
f373cb8
Rename _persist_base64_pieces to _persist_base64_pieces_async
romanlutz Mar 5, 2026
d17f407
Only query lineage when original_prompt_id differs from piece id
romanlutz Mar 5, 2026
2c5ddab
Fix SAS cache TTL to derive from token expiry instead of fixed value
romanlutz Mar 5, 2026
89481b4
Rename _send_and_store_message and _store_message_only with _async su…
romanlutz Mar 5, 2026
8aecad6
Redesign video remix: prompt_metadata DTO, validate_video_remix_piece…
romanlutz Mar 5, 2026
168e552
Add --config-file to pyrit_backend, use FrontendCore for initialization
romanlutz Mar 5, 2026
7c665e3
Strip data URI prefix in _persist_base64_pieces_async
romanlutz Mar 5, 2026
cb668c9
Serve media via URL instead of inline base64 encoding
romanlutz Mar 5, 2026
1a7a796
Re-export PrependedMessageRequest from backend models __init__
romanlutz Mar 5, 2026
d7430b0
Consolidate backend models __init__ exports
romanlutz Mar 5, 2026
edd567f
Fix outdated Phase 2 comment in list_attacks_async
romanlutz Mar 5, 2026
c41d033
Enforce video_id presence on video_path pieces in remix validation
romanlutz Mar 5, 2026
656b642
Deduplicate conversation IDs before querying stats
romanlutz Mar 5, 2026
0770510
Merge remote-tracking branch 'origin/main' into romanlutz/backend-att…
romanlutz Mar 5, 2026
2b92eed
Remove dead code and improve test coverage to 99%
romanlutz Mar 5, 2026
893ed06
Fix test_init_with_defaults: assert None when no config file exists
romanlutz Mar 5, 2026
c47b360
Merge romanlutz/backend-attack-api into romanlutz/frontend_attack_view
romanlutz Mar 5, 2026
cf65c3a
Update frontend types and tests for backend API changes
romanlutz Mar 5, 2026
7dcef74
Merge remote-tracking branch 'romanlutz/romanlutz/frontend_attack_vie…
romanlutz Mar 5, 2026
1513745
Merge remote-tracking branch 'origin/main' into romanlutz/backend-att…
romanlutz Mar 6, 2026
3c7d56f
fix: address PR review comments from hannahwestra25 and copilot
romanlutz Mar 6, 2026
f3617f2
fix: add type ignore for ContainerSasPermissions across mypy versions
romanlutz Mar 6, 2026
4744fb2
Merge remote-tracking branch 'romanlutz/romanlutz/backend-attack-api'…
romanlutz Mar 6, 2026
ab10716
fix: mock DEFAULT_CONFIG_PATH in test_init_with_defaults for CI
romanlutz Mar 6, 2026
b48a084
feat: add centralized ApiError type and toApiError() helper
romanlutz Mar 6, 2026
70c6e2c
feat: add Axios interceptors for request-ID and error logging
romanlutz Mar 6, 2026
e78e551
feat: add X-Request-ID middleware for frontend-backend log correlation
romanlutz Mar 6, 2026
4614a87
feat: add useConnectionHealth hook + ConnectionHealthProvider
romanlutz Mar 6, 2026
33dc890
feat: add ConnectionBanner for global connection status display
romanlutz Mar 6, 2026
4330229
feat: add ErrorBoundary with try-again and reload fallback
romanlutz Mar 6, 2026
214930e
feat: add error state + retry to AttackHistory
romanlutz Mar 6, 2026
de62e7d
feat: add error state + retry to ConversationPanel
romanlutz Mar 6, 2026
612fde8
feat: refactor ChatWindow to use toApiError + preserve failed text
romanlutz Mar 6, 2026
e222f78
refactor: use toApiError() in TargetConfig for consistent error messages
romanlutz Mar 6, 2026
c4afd65
fix: restrict media endpoint to allowed subdirectories and block sens…
romanlutz Mar 6, 2026
fb22c3a
feat: add onError fallback for video/audio media elements
romanlutz Mar 6, 2026
0f6548b
feat: wire ErrorBoundary, ConnectionHealthProvider, ConnectionBanner …
romanlutz Mar 6, 2026
658199b
docs: document health endpoint contract for frontend polling
romanlutz Mar 6, 2026
4bd4e5a
Merge remote-tracking branch 'romanlutz/romanlutz/backend-attack-api'…
romanlutz Mar 6, 2026
696fba2
test: improve coverage and simplify ConnectionBanner
romanlutz Mar 6, 2026
b3556c4
fix: address hannahwestra25 review comments (round 2)
romanlutz Mar 7, 2026
f4a83c8
refactor: generate attack_result_id in AttackResult constructor
romanlutz Mar 7, 2026
2532c26
fix: rename label key operator_name -> operator for consistency
romanlutz Mar 7, 2026
74b7be2
refactor: standardize label keys to 'operator' and 'operation'
romanlutz Mar 7, 2026
05502d1
fix: address ValbuenaVC review comments
romanlutz Mar 7, 2026
0c78518
Merge remote-tracking branch 'origin/main' into romanlutz/backend-att…
romanlutz Mar 7, 2026
16d6d5c
docs: use consistent label examples across notebooks
romanlutz Mar 9, 2026
6b7949e
Merge remote-tracking branch 'origin/main' into romanlutz/frontend_at…
romanlutz Mar 9, 2026
5bf2853
Merge remote-tracking branch 'romanlutz/romanlutz/backend-attack-api'…
romanlutz Mar 9, 2026
84d6808
fix: address PR review comments (2-6)
romanlutz Mar 9, 2026
36ab1c2
fix: address older PR review comments (D, E)
romanlutz Mar 9, 2026
578ef67
fix: align api.test.ts mocks with backend contract
romanlutz Mar 9, 2026
6ddea53
Merge remote-tracking branch 'origin/main' into romanlutz/frontend_at…
romanlutz Mar 9, 2026
e31e583
feat: support operator/operation labels from config file
romanlutz Mar 9, 2026
a7e9c22
fix: detect actual Vite port in dev.py status message
romanlutz Mar 10, 2026
acee8b9
fix: wait for backend health before declaring servers running
romanlutz Mar 10, 2026
44f1bb5
fix: pipe backend output so status banner appears after init
romanlutz Mar 10, 2026
b799195
fix: kill stale processes on ports 8000/3000 during stop
romanlutz Mar 10, 2026
a2cecd9
fix: --database default no longer overrides config file
romanlutz Mar 10, 2026
be5c9cc
feat: add E2E error scenario tests
romanlutz Mar 10, 2026
7fc3269
Merge remote-tracking branch 'origin/main' into romanlutz/frontend_at…
romanlutz Mar 10, 2026
ba3e0f7
feat: persist history view filters across navigation with reset button
romanlutz Mar 10, 2026
2aeb18f
fix: resolve all frontend lint errors and warnings
romanlutz Mar 10, 2026
7062730
fix: show all target params (e.g. reasoning_effort) in target config …
romanlutz Mar 10, 2026
f017454
test: add comprehensive tests for target_specific_params display
romanlutz Mar 10, 2026
0c55662
fix: auto-open conversations panel on branch/copy actions
romanlutz Mar 10, 2026
c5ae445
fix: prevent continuing conversation after switching targets
romanlutz Mar 10, 2026
50d8713
fix: auto-resolve video_id metadata for video remix in GUI
romanlutz Mar 10, 2026
07ef599
feat: propagate video metadata through frontend for seamless remix
romanlutz Mar 10, 2026
2a484df
fix: preserve video_path pieces in request so they appear in chat UI
romanlutz Mar 10, 2026
7db65f6
fix: render binary_path pieces as file attachments instead of text
romanlutz Mar 11, 2026
d9d1ae6
fix: rename labels to label in listAttacks params to match backend
romanlutz Mar 11, 2026
2091ddf
fix: normalize empty converter_types so empty query means no-converte…
romanlutz Mar 11, 2026
fc59abd
fix: replace tail with pure Python log tailing for Windows compatibility
romanlutz Mar 11, 2026
e263542
fix: use datetime instead of str for ConversationSummary.created_at
romanlutz Mar 11, 2026
772ce9d
Merge remote-tracking branch 'origin/main' into romanlutz/frontend_at…
romanlutz Mar 11, 2026
7e67f6e
fix: re-sign blob URLs with expired SAS tokens instead of skipping
romanlutz Mar 11, 2026
e18108f
Fix three systemic issues in seeded e2e flow tests
romanlutz Mar 12, 2026
617c185
Address PR review comments, expand GUI docs, fix and add e2e/unit tests
romanlutz Mar 12, 2026
be8e410
refactor: convert ErrorBoundary to functional component using react-e…
romanlutz Mar 12, 2026
d12f41f
Merge remote-tracking branch 'origin/main' into romanlutz/frontend_at…
romanlutz Mar 12, 2026
0d4b59c
fix: add loadConversation to useEffect deps to fix ESLint warning
romanlutz Mar 12, 2026
aa4482e
fix: run mock e2e tests in CI instead of seeded (no secrets needed)
romanlutz Mar 13, 2026
c5bc1ef
Refactor frontend: consolidate banners, rename hasMore, add tests, ex…
romanlutz Mar 13, 2026
c96f8ea
docs: add operator and operation label examples to .pyrit_conf_example
romanlutz Mar 13, 2026
1fc43a2
fix: use useLayoutEffect for textarea auto-resize to avoid flicker
romanlutz Mar 13, 2026
1398256
fix: remove broken GitHub user-attachment image links from GUI docs
romanlutz Mar 13, 2026
e760280
Revert "fix: remove broken GitHub user-attachment image links from GU…
romanlutz Mar 13, 2026
cdc2cd1
fix: add GUI screenshots to repo and use local paths in docs
romanlutz Mar 13, 2026
24f264a
Merge remote-tracking branch 'origin/main' into romanlutz/frontend_at…
romanlutz Mar 13, 2026
07df2c5
nit: update .pyrit_conf_example defaults to roakey/op_trash_panda
romanlutz Mar 13, 2026
3ae8718
Move messages state from App.tsx into ChatWindow.tsx
romanlutz Mar 13, 2026
13bb78d
docs: simplify operator/operation description in .pyrit_conf_example
romanlutz Mar 13, 2026
5376b82
revert: undo .gitattributes changes
romanlutz Mar 13, 2026
5775503
test: add video target remix test with text+video_path pieces
romanlutz Mar 13, 2026
837d09b
fix: restore Python/uv setup in e2e CI job
romanlutz Mar 13, 2026
d351937
test: add missing test files for TargetTable and HistoryPagination
romanlutz Mar 13, 2026
9a408a9
fix: tag api.spec.ts tests as @seeded since they need a real backend
romanlutz Mar 13, 2026
2d57de8
fix: Docker GUI uses pyrit_backend CLI, mounts .pyrit_conf, documents…
romanlutz Mar 13, 2026
a0f5c9d
fix: simplify Docker auth - managed identity on Azure, service princi…
romanlutz Mar 13, 2026
182d351
fix: resolve ruff and mypy pre-commit errors in auth middleware
romanlutz Mar 18, 2026
202c7c7
fix: ACA deployment - disable PE, fix auth scope, update docs
Mar 23, 2026
f85d297
feat: security hardening + CI/CD pipeline for CoPyRIT GUI
Mar 25, 2026
0135b80
fix: use template expression to conditionally include prod stage
Mar 25, 2026
c6eee8a
fix: move service connection to compile-time variable
Mar 25, 2026
8aede38
fix: remove RBAC role assignments from Bicep template
Mar 25, 2026
15ce361
fix: supply chain warnings and auth redirect race condition
Mar 26, 2026
ac7c43e
fix: point .npmrc to Azure Artifacts feed (CFS0003)
Mar 26, 2026
5680f28
docs: move CSSC rationale from inline comments to infra/README.md
Mar 26, 2026
9c87d44
revert: use npmjs.org directly instead of Azure Artifacts feed
Mar 26, 2026
688a3a7
feat: multi-group auth support, remove OID allowlist
Mar 27, 2026
26fc982
fix: allow Azure Blob Storage in CSP for images and media
Mar 27, 2026
88f2d21
docs: add dev workflow, fix pipeline variable name
Mar 27, 2026
5ba1204
fix: migrate groups overage from graph.windows.net to graph.microsoft…
Mar 27, 2026
13fa226
fix: pass envSecretName to Bicep for per-environment KV secrets
Mar 27, 2026
0b70076
docs: scrub internal names from IaC and README for open-source readiness
Mar 30, 2026
1c211f6
Merge main and resolve conflicts
Mar 30, 2026
e082241
Fix npm ci peer dependency conflict with legacy-peer-deps
Mar 31, 2026
7fa4a80
Add tests for auth module to meet coverage thresholds
Mar 31, 2026
a324b30
Fix ESLint: replace require() with dynamic import() in msalConfig tests
Mar 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .pyrit_conf_example
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ initializers:
operator: roakey
operation: op_trash_panda

# Operator and Operation Labels
# ------------------------------
# Default labels applied to all attacks created with PyRIT.
#
# - operator: Identifies who is running the attack (e.g., your team name or alias).
# - operation: Groups related attacks under a campaign or engagement name.
#
# Both are optional.
operator: roakey
operation: op_trash_panda

# Initialization Scripts
# ----------------------
# List of paths to custom Python scripts containing PyRITInitializer subclasses.
Expand Down
2 changes: 1 addition & 1 deletion build_scripts/prepare_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def build_frontend(frontend_dir: Path) -> bool:
print("\nInstalling frontend dependencies...")
try:
subprocess.run(
["npm", "install"],
["npm", "install", "--legacy-peer-deps"],
cwd=frontend_dir,
check=True,
stdout=subprocess.PIPE,
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
# python docker/build_pyrit_docker.py --source pypi --version 0.10.0
# ============================================================================

# Use the devcontainer as base (built by build_pyrit_docker.py)
ARG BASE_IMAGE=pyrit-devcontainer
# No default — callers must pass --build-arg BASE_IMAGE=... (see infra/README.md).
ARG BASE_IMAGE
FROM ${BASE_IMAGE} AS production

LABEL description="Docker container for PyRIT with Jupyter Notebook and GUI support"
Expand Down
44 changes: 42 additions & 2 deletions docker/QUICKSTART.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,40 @@ Docker container for PyRIT with support for both **Jupyter Notebook** and **GUI*

## Prerequisites
- Docker installed and running
- `.env` file at `~/.pyrit/.env` with API keys
- Optionally, `~/.pyrit/.env.local` for additional environment variables
- `~/.pyrit/.env` with your API keys and Azure service principal credentials
- `~/.pyrit/.pyrit_conf` with your configuration (operator, operation, initializers)
- Optionally, `~/.pyrit/.env.local` for additional environment overrides

## Azure Authentication in Docker

`DefaultAzureCredential` is used automatically. The method depends on
where the container runs:

### Azure infrastructure (AKS, ACI, Azure VM)

Managed identity works out of the box — no configuration needed.
Assign the managed identity the **Cognitive Services OpenAI User** role
on your Azure OpenAI resources.

### Local Docker Desktop

Managed identity is not available locally. Use a **service principal**
by adding these variables to your `~/.pyrit/.env`:

```bash
AZURE_TENANT_ID=<your-tenant-id>
AZURE_CLIENT_ID=<your-client-id>
AZURE_CLIENT_SECRET=<your-client-secret>
```

The Azure SDK picks these up automatically and refreshes tokens
without any manual intervention.

To create a service principal:
```bash
az ad sp create-for-rbac --name pyrit-docker --role "Cognitive Services OpenAI User" \
--scopes /subscriptions/<sub-id>/resourceGroups/<rg>/providers/Microsoft.CognitiveServices/accounts/<account>
```

## Quick Start

Expand Down Expand Up @@ -41,6 +73,11 @@ GUI mode (port 8000):
python docker/run_pyrit_docker.py gui
```

The run script automatically mounts these files from `~/.pyrit/`:
- `.env` — API keys and service principal credentials (required)
- `.env.local` — Additional environment overrides (optional)
- `.pyrit_conf` — PyRIT configuration: operator, operation, initializers (optional)

## Image Tags

Images are tagged with version information:
Expand Down Expand Up @@ -77,6 +114,9 @@ docker-compose --profile gui up

**.env missing**: Create `.env` file at `~/.pyrit/.env` with your API keys

**Azure auth fails in container**: Add `AZURE_TENANT_ID`, `AZURE_CLIENT_ID`, and
`AZURE_CLIENT_SECRET` to your `.env` file (see Azure Authentication section above)

**GUI frontend missing**: Build with `--source local` (PyPI builds before GUI release won't work)

For complete documentation, see [docker/README.md](./README.md)
2 changes: 2 additions & 0 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ services:
- ../assets:/app/assets
- ~/.pyrit/.env:/home/vscode/.pyrit/.env:ro
- ~/.pyrit/.env.local:/home/vscode/.pyrit/.env.local:ro
- ~/.pyrit/.pyrit_conf:/home/vscode/.pyrit/.pyrit_conf:ro
- ~/.azure:/home/vscode/.azure
environment:
- PYRIT_MODE=gui
restart: unless-stopped
Expand Down
14 changes: 14 additions & 0 deletions docker/run_pyrit_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def run_container(mode, tag="latest"):
pyrit_config_dir = Path.home() / ".pyrit"
env_file = pyrit_config_dir / ".env"
env_local_file = pyrit_config_dir / ".env.local"
pyrit_conf_file = pyrit_config_dir / ".pyrit_conf"

print("🐳 PyRIT Docker Runner")
print("=" * 60)
Expand Down Expand Up @@ -69,10 +70,12 @@ def run_container(mode, tag="latest"):

# Build docker run command
# Mount env files to ~/.pyrit/ where PyRIT expects them
# Use -it for interactive mode (needed for az login device code prompt)
cmd = [
"docker",
"run",
"--rm",
"-it",
"--name",
container_name,
"-p",
Expand All @@ -88,6 +91,17 @@ def run_container(mode, tag="latest"):
print(f" Found .env.local - including it")
cmd.extend(["-v", f"{env_local_file}:/home/vscode/.pyrit/.env.local:ro"])

# Add .pyrit_conf if it exists (sets operator, operation, initializers)
if pyrit_conf_file.exists():
print(f" Found .pyrit_conf - including it")
cmd.extend(["-v", f"{pyrit_conf_file}:/home/vscode/.pyrit/.pyrit_conf:ro"])

# Mount Azure CLI config so 'az login' tokens persist across container restarts
azure_dir = Path.home() / ".azure"
if azure_dir.exists():
print(f" Found .azure/ - mounting for Azure CLI auth")
cmd.extend(["-v", f"{azure_dir}:/home/vscode/.azure"])

cmd.append(f"pyrit:{tag}")

print()
Expand Down
29 changes: 28 additions & 1 deletion docker/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,41 @@ fi
echo "Checking PyRIT installation..."
python -c "import pyrit; print(f'Running PyRIT version: {pyrit.__version__}')"

# Write .env file from PYRIT_ENV_CONTENTS (injected from Key Vault secret)
if [ -n "$PYRIT_ENV_CONTENTS" ]; then
mkdir -p ~/.pyrit
echo "$PYRIT_ENV_CONTENTS" > ~/.pyrit/.env
echo "Wrote .env file from PYRIT_ENV_CONTENTS ($(wc -l < ~/.pyrit/.env) lines)"
else
echo "No PYRIT_ENV_CONTENTS set — using system environment variables only"
fi

# Start the appropriate service based on PYRIT_MODE
if [ "$PYRIT_MODE" = "jupyter" ]; then
echo "Starting JupyterLab on port 8888..."
echo "Note: Notebooks are from the local source at build time"
exec jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --allow-root --NotebookApp.token='' --NotebookApp.password='' --notebook-dir=/app/notebooks
elif [ "$PYRIT_MODE" = "gui" ]; then
echo "Starting PyRIT GUI on port 8000..."
exec python -m uvicorn pyrit.backend.main:app --host 0.0.0.0 --port 8000
# Use Azure SQL if AZURE_SQL_SERVER is set (injected by Bicep), otherwise default to SQLite.
# Note: AZURE_SQL_DB_CONNECTION_STRING is in the .env file (loaded by Python dotenv),
# but we use AZURE_SQL_SERVER here because it's a direct env var from the Bicep template.
# Build CLI arguments
BACKEND_ARGS="--host 0.0.0.0 --port 8000"

if [ -n "$AZURE_SQL_SERVER" ]; then
echo "Using Azure SQL database (server: $AZURE_SQL_SERVER)"
BACKEND_ARGS="$BACKEND_ARGS --database AzureSQL"
else
echo "Using SQLite database (AZURE_SQL_SERVER not set)"
fi

if [ -n "$PYRIT_INITIALIZER" ]; then
echo "Using initializer: $PYRIT_INITIALIZER"
BACKEND_ARGS="$BACKEND_ARGS --initializers $PYRIT_INITIALIZER"
fi

exec python -m pyrit.cli.pyrit_backend $BACKEND_ARGS
else
echo "ERROR: Invalid PYRIT_MODE '$PYRIT_MODE'. Must be 'jupyter' or 'gui'"
exit 1
Expand Down
3 changes: 3 additions & 0 deletions frontend/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Pin npm registry — satisfies CSSC CFS0001 (sibling .npmrc required).
registry=https://registry.npmjs.org/
legacy-peer-deps=true
Loading
Loading