Skip to content

7.2.0

Choose a tag to compare

@rennf93 rennf93 released this 23 Jun 21:13
· 30 commits to master since this release
d86e6a0
  • Added — Clear, actionable agent-setup errors + opt-in strict mode. When enable_agent=True but the guard-agent package is missing, the middleware now surfaces pip install fastapi-guard[agent] instead of the misleading "invalid config / check agent_api_key" path — it catches AgentPackageNotInstalledError from guard-core 3.2.0. Agent-init failures degrade gracefully by default (they log, set agent_degraded — exposed via agent_stats — and fire the on_error(stage="agent_init") hook), while the new SecurityConfig.agent_strict=True re-raises for fail-fast deployments.
  • Addedfastapi-guard[agent] optional-dependency extra that installs guard-agent, so the agent is opt-in rather than a hidden requirement.
  • Changedguard.__all__ is now single-sourced from guard_core.__all__ plus fastapi-guard's two locals (SecurityMiddleware, __version__) instead of being hand-duplicated, so the two export lists can no longer silently drift; a test enforces it.
  • Docs — New "Passive to Active" migration guide: a reversible observe → preview → verify → enforce → rollback path for turning enforcement on, including a read-only "would-block preview" to size the blast radius before flipping passive_mode.
  • Docs — Behavioral decorators now document the required wiring step. The behavioral tutorial and the simple_app example include app.state.guard_decorator = guard_deco — the step that makes decorator rules actually fire — plus how to verify violations (decorator_violation event) and trial safely with passive_mode.
  • Compatibility — Requires guard-core 3.2.0 or newer (the agent-setup clarity relies on AgentPackageNotInstalledError, introduced there). The test suite filters guard-core's new ipinfo_* DeprecationWarning.

What's Changed

  • Bump actions/checkout from 6 to 7 by @dependabot[bot] in #90
  • docs: correct API & config reference to match source by @rennf93 in #91
  • feat(agent): clear missing-package error, opt-in strict, on_error hook (O1/O2) by @rennf93 in #92
  • refactor(exports): single-source all from guard_core (O3) by @rennf93 in #96
  • docs(security): add Passive to Active migration guide (O7) by @rennf93 in #94
  • docs(behavioral): document the required decorator wiring step (O8) by @rennf93 in #95
  • ci(docs): serialize docs deploys to prevent gh-pages races by @rennf93 in #97
  • release: v7.2.0 — agent-setup clarity, single-source exports, adoption docs by @rennf93 in #98

Full Changelog: 7.1.1...7.2.0