Why AI CareerBot didn’t turn off context because of PII
In AI CareerBot, users paste resumes with full names, phone numbers, and addresses. Here’s why we didn’t disable context and how we filter PII before the GigaChat API.

Turning context off completely because of PII is too blunt an approach.
In AI CareerBot, users bring chunks of resumes into the chat. Quite often, along with useful content, they also include everything that normally sits at the top of a resume: full name, phone number, address. For a career assistant, this is a normal input: people are not going to manually clean a document before asking it to rewrite their experience or adapt the wording.
We needed to bring personal data processing in line with the policy under Federal Law 152-FZ without turning the conversation into a one-off form. The bot has to remember what was being discussed; otherwise, follow-ups lose their meaning.
The obvious option
The first option looked as safe as possible: do not store conversation context. Process each request separately and send only the current message, after PII filtering, to the GigaChat API.
On paper, that is neat. No long history means less risk of personal data traveling further down the pipeline. If the user pasted a resume with a phone number, the filter removed the phone number, the model replied, and the context was reset.
But for AI CareerBot, this breaks the core scenario. Users rarely phrase the task in one perfect message. After the first response, short commands follow: “make it shorter,” “rewrite it for a product manager role,” “keep more facts about sales,” “and now in English.” Without saved context, the bot does not understand what exactly needs to be changed.
The most frustrating part was this: if you turn context off, the user starts pasting the same resume fragment again. In other words, the safe option encourages resending the same personal data into the chat. We would remove memory from the system, but not the user’s habit of copying the resume in full.
Why filtering the whole dialog is harder than filtering one message
In this scenario, PII does not live only in the first message. The user may add a phone number later, уточнить the address, paste a new resume fragment, or quote an old one after the bot has already replied.
That is why the filter cannot be tied only to the first input. Before each call to the external model, we need to assemble the context and clean exactly the version that will go to the GigaChat API. The working context keeps the meaning of the dialog: experience, job titles, skills, the user’s request. Personal fields — full name, phone numbers, addresses — must not go into the model request.
This is where we had to draw a line. If you remove too much, the bot starts answering in generic phrases: it no longer has enough material from the resume. If you leave too much, you violate the very purpose of the PII processing policy. So the filtering was built around the specific types of personal data that actually showed up in user input: names, contact details, addresses.
What we chose instead of disabling context
We kept the conversational context because without it the career bot becomes an annoying one-message editor. But before sending data to the GigaChat API, we added a PII filtering layer based on a policy aligned with 152-FZ.
The flow looks like this:
- the user writes to AI CareerBot and may paste a resume fragment;
- the conversation context is preserved so follow-ups work meaningfully;
- before calling the GigaChat API, a sanitized version of the context is assembled;
- personal data is removed from it: full names, phone numbers, addresses;
- the model receives the career-related meaning of the request, but not the personal fields.
An important trade-off: we do not force the user to prepare a “safe” version of the resume in advance. That is almost always a losing UX. Instead, the system accepts input as it was sent, and it draws the boundary for the external API itself.
For career conversations, this is critical. The phrase “adapt my experience for a job opening” should still work several messages after the resume was pasted. At the same time, the next request to the GigaChat API goes out without the full name, phone number, or address.