Security foundations Fail open vs. fail closed 2 min read
Fail open vs. fail closed
Someone opens a link to a private invoice. The file is available, but the permission check times out. Should the app return the file?
-
The app has no access decision
The timeout tells the app it couldn’t complete the check. In this example, failing open would send the invoice anyway. Failing closed would withhold it and report that access could not be verified.
In short Treat an unavailable check as its own outcome.
-
Withhold the file and explain the problem
The invoice service chooses to fail closed. It returns a temporary error and allows the reader to retry later. The error explains the interruption without suggesting that the person’s permission was removed.
In short Keep the protected action blocked until you can verify access.
Where this example stops
Failing closed can interrupt legitimate work during an outage. Design a retry path or a limited mode that leaves the protected action blocked.
Keep this
Decide what happens when the check cannot finish.
Test the timeout path and confirm the protected file stays private.