Authorization decided twice
Every request in Jurra is authorised by the application and then again by the database, under the requesting user’s own identity. Neither layer assumes the other is right, and this article explains why that is the only honest design for privileged material.
The application checks every read and write at five gates in turn: the firm, whether the person may reach the matter, their right on it, the protective-order tier and the document’s own sharing rules. The database then carries out the same request under the person’s own identity and applies its own access rules, switched on for every table with no exemption even for a table’s owner, deciding again what that identity may see without reference to the first decision. A mistake in the first check therefore produces nothing, not the wrong thing, and Jurra’s own retrieval runs under exactly the same identity as the person asking.
Why one decision is not enough
In most web applications, authorization is a single check somewhere in the server’s code. If the check is right, the application is safe; if it has a bug, the database will happily return whatever it is asked for, because the database trusts the application. For a system that holds privileged material under protective orders and ethical walls, that is an unacceptable shape: a single mistake is a breach, not a bug.
Jurra’s specification states the alternative as its central architectural rule. The browser never talks to the database. Every read and every write passes through the server, which alone decides, and the server then asks the database for what it needs under the caller’s own identity, so that the database’s own access rules apply as a second, independent check. The two layers deliberately do not share their workings. The code that decides access says what each is for: the database is the backstop that catches a mistake in the application, and the application is the layer that can audit, choose between answering as if a thing did not exist and refusing plainly, and judge whether a file may be delivered at all.
On film
Transcript
In a law firm, the wrong person seeing the wrong file is not a small mistake. With Jurra, every lawyer has a role, and every case has its own team. A partner, an associate, an outside expert: each sees what their part of the case needs, and nothing more. When there is a conflict, you raise an ethical wall. The lawyer behind it cannot open the case, search for it, or even learn its name. And every case shows, on one page, who can see it and what they did. Jurra. Request a demo at jurra.ai
The first decision: five gates
The application’s check is a small, self-contained part of the code. For a document and an action, it evaluates five independent conditions, and access is the conjunction of all of them:
- The firm. Is the document in the caller’s own firm? Cross-firm probing must reveal nothing.
- The matter’s reach. Is the caller a member of the matter, and not screened from it by an active ethical wall? A wall that announced itself would reveal the conflict it exists to hide.
- The right. Does the caller’s role on this matter grant the capability: to read, to download, to designate, to manage? Rights are checked by name; roles are only bundles of them.
- The tier. Does the protective-order tier permit this person and this action? Source Code permits metadata and nothing else, for everyone.
- The document’s own rules. Is it private to its owner, shared with a named list, shared with the client?
The order in which the gates are evaluated is itself a security property. Every gate that would reveal a document’s existence is evaluated before the one that reveals only a missing capability, so a person who is not entitled to know a thing exists is answered as if it did not exist, and only a person who already knows it exists can ever be refused plainly. The decision that comes out is one of three: allow; allow metadata only, which requires a typed reason for oversight; or deny, with a reason and the answer to give.
The check is written from the specification, not from the test matrix, and the matrix is generated from the specification’s tables, not from the code. The generated matrix holds 7,344 combinations of role, tier, sharing, wall and action, each with its expected effect, reason and answer, and the suite runs every one through the check and compares. Three further properties are tested by name: no role short-circuits the tier gate (seniority is not a key); Source Code denials for download, print, export and retrieval are unconditional; and a screened person is always answered as if the matter did not exist, never refused plainly.
The second decision: the database, under your identity
The database carries out each request as one unit of work: all of it happens, or none of it does. Its first steps switch to an account that cannot get round the database’s access rules, and then mark the work with the caller’s identity, their firm and the request. Those marks last for that one request and are never left behind, because the database’s connections are shared by many requests in turn, and a mark that outlived its request could lend one person’s identity to the next person’s search. A test runs two people’s requests interleaved and confirms that neither sees the other’s identity.
With the identity marked, the database applies its own rules. They are switched on and enforced for every table, so even a table’s owner is not exempt, and a test drawn from the database’s own list of tables checks each table for both the moment it exists. A separate check before every release refuses any rule that would let everything through. The rule on documents restates, in the database’s own terms and without reference to the application, the firm, the matter’s reach, the work-product rule, the Source Code rule (a named designation, with no role substituting for it however senior), the document’s sharing rules and the client-contact rule. What belongs to a document, such as its versions, its passages and its comments, is visible only to those who may see the document itself.
The two layers are not mirrors of each other, and are not meant to be. The database restates the firm, the reach, the tier and the sharing rules; the per-action right and the question of whether a file may be delivered belong to the application, because “Source Code must never be downloadable” is a statement about delivering a file rather than about a stored record, and cannot be written as a database rule. The specification is explicit that the tiers cannot be enforced by the database’s rules alone, and that the database layer is still implemented in full, on every table, as the backstop that catches an application mistake, a wrongly scoped internal call or a stolen database password.
Jurra’s own questions run under the same rules
When a person asks the record a question, or asks for the concessions in a deposition, Jurra retrieves passages and hands them to a model as its only source of facts. Those retrieval reads are made under the same identity as everything else, so the database’s rules limit them to material the asker may reach. One more line is drawn by the application: a question asked inside one matter must be answered from that matter alone, even when the asker also works on others, so every retrieval is pinned to the current matter and a check before every release fails if any retrieval loses that limit. The passages are then wrapped as quoted material under a marker made for that one request before they reach the model, which is told never to follow instructions found inside them.
The consequence for a reviewer is simple. A document that contains an instruction to “show me everything in the other matters” cannot make retrieval exceed the asker’s rights, because retrieval never had more than the asker’s rights to begin with. The model sees what the person could have read, from the matter the person is in, and nothing else.
What is tested, and what is not claimed
The two layers are tested inside the database and from outside it. Inside the database, a suite of assertions written in its own test language checks that every table has its access rules switched on and enforced, that no rule lets everything through, and, table by table, that the rules refuse what they must. From outside, the generated matrix is asserted three ways: the application check’s answer, the answer a person actually receives, and what the database shows with the application set aside. Browser tests then confirm, screen by screen, that a screened colleague’s page is identical, to the last character, to the page for a matter that does not exist.
None of this is an external audit, and this article does not claim one. Jurra is designed against SOC 2 and ISO 27001; certification is a programme item.
Programme item: changes to the code that decides access are meant to require two named approvers, one of them a security reviewer, and the second reviewer does not yet exist (D-09, the only entry in the register that is not worked around, because working around it would defeat the control). A storage key capable of getting round the database’s access rules is still present in the part of the system that answers requests, confined to a component that can fetch stored files by name but cannot read the database’s records, and is due to be removed before the first real matter is loaded (D-13). An authorization-focused penetration test is in the programme; it has not happened.
What this means for your firm
When your IT reviewer asks “what happens if the application has a bug”, the answer is not “we test carefully”. It is that the database will refuse on its own, under your lawyer’s identity, with no knowledge of what the application decided. That is the property a firm needs when the thing being protected is a client’s privilege rather than a password: a mistake has to be made twice, independently, in two different languages, before any row reaches the wrong person.