Skip to content

Harden public API write and compute routes#224

Open
MaxGhenis wants to merge 1 commit intomainfrom
codex/security-hardening-audit-v2
Open

Harden public API write and compute routes#224
MaxGhenis wants to merge 1 commit intomainfrom
codex/security-hardening-audit-v2

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

Summary

  • require the shared expensive-endpoint guard on public policy, dynamic, aggregate, household, and agent write routes
  • protect additional expensive analysis POST routes and restrict CORS to a configured allowlist
  • remove anonymous database access from generated RLS policies and add security regression coverage

Testing

  • uv run pytest tests/test_outputs.py tests/test_change_aggregates.py tests/test_security.py -q
  • uv run ruff check src/policyengine_api/security.py src/policyengine_api/config/settings.py src/policyengine_api/main.py src/policyengine_api/api/analysis.py src/policyengine_api/api/outputs.py src/policyengine_api/api/change_aggregates.py src/policyengine_api/api/agent.py src/policyengine_api/api/policies.py src/policyengine_api/api/dynamics.py scripts/init.py tests/test_security.py

@MaxGhenis MaxGhenis force-pushed the codex/security-hardening-audit-v2 branch 7 times, most recently from 8520734 to 8f08795 Compare April 12, 2026 19:37
@MaxGhenis MaxGhenis force-pushed the codex/security-hardening-audit-v2 branch from 8f08795 to 9aa096b Compare April 12, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant