If sqlalchemy-oso session setup breaks right after a flask or werkzeug upgrade, pin werkzeug to 2.0.3 ahead of flask in your requirements file as an immediate workaround, then upgrade past the fixed releases. Dependency upgrades breaking Oso's session helpers is a known pattern, so check the werkzeug pin first before debugging your policy.

Context: Issue osohq/oso#1548 (closed): create_scoped_session failed on the latest flask and werkzeug 2.1.x releases. A contributor opened PR 1559 with a fix, and multiple users confirmed the workaround of pinning werkzeug to 2.0.3 before installing flask. One user noted the underlying fix shipped in the Werkzeug 2.2.0 release.