The model should receive only the information needed for a specific task.
The system first finds relevant excerpts and prepares the context.
An AI response is no substitute for checking the source and the full document.
Artificial intelligence can significantly speed up a lawyer's work. It can help find information in documents, summarize meeting outcomes, draft pleadings, identify relevant excerpts or answer questions about an ongoing matter.
In a law firm, however, there is a question more important than convenience itself:
how much information should an AI model receive to perform a specific task?
Our answer is simple.
As little as possible.
An agent should not receive entire case files just because a lawyer asked one question. Nor should it have unrestricted access to every document, recording, client and matter at the firm.
At BezpiecznaKancelaria.pl, we have adopted a different architecture.
First, the system determines what information is needed to provide an answer. Only then can selected excerpts be passed to the language model.
Users may feel that the agent knows the entire firm.
In practice, it sees only what the system has chosen to show it for a specific task.
AI itself is not the problem. Uncontrolled access to data is
Discussions about artificial intelligence security often come down to one question:
“Can law firm documents be sent to AI?”
This question is too broad.
What matters more is:
which documents, which excerpts, for what purpose and to what extent should be shared?
Imagine that a lawyer wants an answer to this question:
“What was agreed with the client regarding the payment deadline?”
The answer may require two paragraphs from a contract, an excerpt from a meeting note and several dozen seconds of a call transcript.
There is no reason to share with them:
- the client's full history,
- all documents in the matter,
- materials from other proceedings,
- recordings unrelated to the question,
- information about other clients,
- other data held by the firm.
The model should receive only what it actually needs.
This is what we call context control.
First, the data remains in the firm's secure environment
We do not treat law firm documents as ordinary files stored online.
Pleadings, documents, recordings and other materials created and stored in Bezpieczna Kancelaria are kept in an isolated environment and encrypted.
This includes:
- documents uploaded to the system,
- pleadings drafted by the firm,
- materials related to matters,
- recordings,
- transcripts,
- content later used by AI features.
However, data storage is only the first component of the architecture.
If the system is to help a lawyer find an answer across hundreds of documents, it must be able to identify which excerpts relate to the question.
That is what the next layer does.
Documents are prepared for semantic search
Content held by the firm is converted into vectors.
It sounds technical, but the idea itself is relatively simple.
A traditional search engine usually looks for specific words. If we enter “payment deadline”, it may find documents containing that exact phrase.
Semantic search goes further. The system can find information related to the meaning of the question, even if the document uses different wording.
This makes it possible to search for relevant excerpts in:
- contracts,
- pleadings,
- notes,
- recording transcripts,
- documents prepared by the firm.
The information required for this type of search is stored in a dedicated vector database.
Its purpose is not to replace the documents. It helps the system find the parts of the materials that may be needed for a specific task.
The agent cannot freely search the entire firm
This is one of the most important elements of the Bezpieczna Kancelaria architecture.
When a user asks the agent a question, we do not provide the model with the entire dataset and ask it to select the information it needs.
The Bezpieczna Kancelaria system acts first.
The process can be simplified into a few steps:
- the lawyer asks a question,
- the system analyzes what information may be needed to answer it,
- the relevant dataset is searched,
- the vector database identifies the most relevant excerpts,
- the system prepares a limited context,
- only this context is then passed to the language model,
- the model prepares an answer for the user.
The model therefore does not receive the keys to the entire archive.
The system brings it only the pages that may be needed to perform a specific task.
That is the fundamental difference.
The user sees an intelligent agent. Underneath, a controlled system is at work
From the user's perspective, everything may look very simple.
The lawyer asks:
„How did the client justify refusing to pay?”
A moment later, they receive an answer based on documents, a note or a conversation stored in the system.
This can create the impression that the agent knows the entire case, all the documents and the firm's history.
But that does not have to be the case.
The agent may receive only a few excerpts selected by the system in advance.
This matters because security is not just about which AI model is used.
What happens before the model receives the question is hugely important.
At Bezpieczna Kancelaria, much of the work is done by this layer:
- finding the right data,
- limiting its scope,
- preparing the context,
- providing only the information needed for the task.
The LLM is the final part of the process, not the system managing the law firm.
We control the agent, not the other way around
In AI systems, it is easy to create an architecture in which the agent is granted broad permissions and independently searches for information that it believes it needs.
For a law firm, this approach requires particular caution.
We have adopted the opposite philosophy.
The system determines:
- which data it should access,
- which information is relevant to the question,
- what context to prepare,
- what is ultimately provided to the model.
The agent does not decide on its own that it needs all case files „just in case”.
We do not design solutions where the model receives a complete picture of the law firm and only then decides what to use.
First, we limit the data.
Only then do we use the model's capabilities.
We control the agent, not the other way around.
Professional secrecy and the principle of information minimization
Lawyers have long followed the principle that confidential information should not be disclosed to anyone who does not need it to perform their task.
The same way of thinking can be applied to artificial intelligence.
If an excerpt from a single document is enough to provide an answer, there is no need to share the entire file.
If the question concerns one case, there is no reason to include materials about another client in the context.
If a short excerpt from the transcript is enough, there is no need to provide the entire recording.
This does not mean that no information can ever be provided to a language model.
It means something more practical:
the model should receive only the information needed to perform a specific task.
In our view, this approach should be one of the basic requirements for using AI responsibly in a law firm.
AI should not receive extra information „just in case”
Traditional IT systems often follow the principle of least privilege.
A user or process should only have access to what it needs to perform its role.
We apply a similar principle to AI.
The model should not receive additional data simply because it may prove useful someday.
Every additional piece of information expands the scope of the context disclosed.
So the question before calling the model should not be:
„What else can we send it?”
but:
„How little data is enough to perform this task correctly?”
This is a small shift in thinking, but a major architectural difference.
Example: analyzing a client conversation
Suppose a law firm has a recording of an hour-long conversation with a client.
The lawyer asks the agent:
„What did the client say about the planned date for selling the property?”
There is no need to send the entire recording to the model.
The system can use a previously prepared representation of the content, find the parts of the conversation concerning the sale and its timing, and then provide only the selected context to the model.
The model prepares an answer based on this material.
For the user, the process takes only a moment.
Under the hood, however, the difference is fundamental:
the agent did not need to learn the entire conversation to answer one specific question.
Example: a question about a legal filing
The same applies to documents.
The lawyer may ask:
„What arguments concerning the limitation period have been raised in this case so far?”
The system can find the most relevant excerpts from legal filings, notes or other materials related to the specified case.
Only these excerpts are used to prepare the context for the model.
There is no need to send all of the client's documents.
There is no need to provide the law firm's entire archive.
Effective selection is what matters.
AI security starts before AI
It is easy to focus the entire discussion on the language model itself:
- who created it,
- where it runs,
- what terms govern its use,
- how long it stores data.
These are important questions.
But the security of a law firm's AI system starts earlier.
It starts with an architecture that determines:
- where the documents are stored,
- how they are protected,
- how the system searches for information,
- who can initiate a given action,
- what data is searched,
- which excerpt becomes the context,
- when information may be passed on.
If the entire archive was sent to the model from the outset, later restrictions have little effect.
That is why Bezpieczna Kancelaria limits the context first.
Only then do we query the model.
AI should assist lawyers without taking over their responsibility
Even the best-protected agent remains a tool.
It can help quickly find information, compare facts, summarize materials and draft a response.
However, it should not replace a lawyer's professional judgment.
An AI response may require:
- checking the source,
- reading the full document,
- assessing the procedural context,
- verifying the current law,
- a decision by the lawyer handling the case.
That is why, at Bezpieczna Kancelaria, artificial intelligence is primarily intended to shorten the path from a question to the right information.
It does not take responsibility for the decision.
Lawyers should know what happens to their data
When choosing an AI system for a law firm, it is worth asking more than whether it has “artificial intelligence features”.
The following questions are far more important:
- Does the agent have access to entire case files?
- Does the system limit the context before sending a query?
- Could data from different clients be combined accidentally?
- Does the search take place before the LLM is invoked?
- Can the scope of information used for the response be controlled?
- How are documents and recordings protected from being used by AI?
- Is the model a tool within the system, or does the system give it control over access to data?
The answers to these questions determine whether AI was genuinely designed for law firms or merely added to existing software.
An agent should know only what it needs to know
Artificial intelligence can be extremely useful in a lawyer's work.
However, this does not require giving it access to all of the firm's knowledge.
At BezpiecznaKancelaria.pl, documents, legal filings and recordings remain in a secure environment. Their content can be prepared for semantic search. When a user asks a question, the system first finds the most relevant information, prepares a limited context and only then passes it to the language model.
The user sees a simple conversation with the agent.
Under the hood, however, a much more complex mechanism limits the amount of information taken outside the relevant context of the case.
Because in a law firm, the question should not be:
“Can AI read all my documents?”
It should be:
“Which information does AI really need to see to complete this one task?”
At Bezpieczna Kancelaria, this is where we start.
Prepared by: BezpiecznaKancelaria.pl
BezpiecznaKancelaria.pl is developing a system for law firms in which artificial intelligence operates as a controlled part of a larger IT environment. Documents, recordings and other information are protected, while the context passed to AI models is prepared by the system for the specific task.

