152-FZ from scratch: personal data, processing purpose and consent
Lesson 1. Personal data and processing begin before a breach
Imagine a club taking registrations for an activity. The organiser asks for a name and email address, saves a spreadsheet, sends a reminder and records attendance. No attacker is involved, yet information is already collected, stored and used. Start by asking why each item is needed, who receives it, and when it stops being useful. Saying that the club has not sold anything does not mean that it has not processed information.
Russian personal data law concerns information related to an identified or identifiable individual. The data subject is that individual. The operator determines the purpose, data composition and operations. Processing includes operations such as storage. These introductory concepts come from Article 3 of Federal Law 152-FZ; a complete legal conclusion depends on the circumstances. In our example, the organiser choosing the registration process is treated as the operator. The participant is the subject. The database is a tool rather than an independent legal operator.
Do not look only for passports or phone numbers. A participant identifier may connect to a person through another table. Replacing a name with student-42 therefore does not demonstrate anonymisation. A support employee might recover the link using an account record. Describe the additional information available and who can use it. All people and addresses in these lessons are fictional. Copying an actual customer export into a training directory is unnecessary.
Lesson 2. Give each action a clear purpose
For a training service, separate account creation, service email, progress storage and advertising. Sign-in associates work with an account; marketing promotes offers. Those purposes differ. A birth date or home address does not become necessary for sign-in merely because adding another form field is easy. Explain the function of each field before considering a less detailed alternative.
A legal basis is the reason a particular processing operation may be permitted. Article 6 provides multiple grounds, so consent is not a universal replacement for a contract or statutory obligation. Our Python program cannot select the appropriate ground. The responsible person considers the circumstances. A beginner should learn to identify an unknown basis and formulate a precise question about the purpose, fields, operation and permission.
Consider a worked example. Delivering an activity reminder requires an email address and an activity identifier. A passport number contributes neither to routing the message nor to identifying the destination mailbox in this model. It is excessive for this function. Another function, such as legally significant documentation, may involve different circumstances. Our finding follows from this task, rather than a claim that passport information is always prohibited.
Lesson 3. Explain the decision that consent records
Where consent is the chosen basis, a person needs an understandable purpose and an opportunity to make their own decision. The official Article 9 text read for this lesson provides separate presentation of consent from other confirmed documents. A single accept-everything checkbox poorly separates an offer, processing and advertising. A privacy policy describes organisation of the process; its presence alone does not establish a specific consent or another legal basis.
The Academy project separates documents and checkboxes. Reading free foundations requires no registration; progress is associated with an account after sign-in. Its configuration still has LEGAL_DRAFT=true, and the proposed Kazan company details remain marked as unverified. This describes the project, rather than a confirmed compliance example. Use a fictional club for this exercise and do not edit the actual site’s legal documents.
Separate a service message from an advertisement by its purpose and content. Renaming an offer to a notification does not change what it does. In your process map, record the actual action and intended recipient. If a developer proposes reusing a reminder mailing list for promotion, ask for a new purpose review before changing the behaviour.
Lesson 4. Run a local minimisation check
Save the following code as purpose_fields.py and run python3 purpose_fields.py. Python 3 works on Windows, Linux and macOS without additional packages. The allowed-field dictionary expresses a fictional product requirement, rather than legal authorisation. The program finds deviations from that requirement and sends nothing to the internet.
On Windows with Python 3 installed, use python instead of python3; the other commands assume a prepared python3 environment. Check it with python --version or python3 --version: expect Python 3.
# purpose_fields.py: fictional purpose/field model
allowed = {'reminder': {'email', 'session_id'},
'progress': {'account_id', 'module_id', 'result'}}
cases = [('reminder', {'email', 'session_id'}, True),
('reminder', {'email', 'session_id', 'passport'}, False),
('progress', {'account_id', 'module_id', 'result'}, True),
('unknown-purpose', {'email'}, False)]
def check(purpose, fields):
if purpose not in allowed:
return False, 'UNKNOWN PURPOSE'
excess = fields - allowed[purpose]
return not excess, ','.join(sorted(excess)) or 'NO EXCESS'
for purpose, fields, expected in cases:
accepted, detail = check(purpose, fields)
assert accepted == expected
print(purpose, 'ACCEPT' if accepted else 'REJECT', detail)
print('four product controls passed; legal basis not evaluated')
Expect ACCEPT, REJECT identifying passport, ACCEPT and REJECT identifying UNKNOWN PURPOSE. The built-in negative control rejects an unnecessary field. This differs from hiding the field in a report after collecting it. Minimisation should first affect the form and request, then storage, logs and exports. The program checks a field set, not actual absence of data across every system.
Practice. Explain your own data map
Create purpose-map.md containing four rows: registration, reminders, progress and advertising. For each, identify the person, purpose, fields, operations, recipient, condition ending retention, and an open question about the legal basis. Write unknown instead of inventing a retention period. Add a support purpose with minimal fields to the program, plus two controls: an acceptable request and one containing an unnecessary home address. Save the source and actual terminal output.
Acceptance requires explaining every field without an unspecified future use, distinguishing the person from the storage tool, detecting an unknown purpose and preserving the negative result. End by listing decisions needing confirmation from the process owner. Deleting your exercise file cleans only your training directory. It does not establish destruction of data in a service’s backups.
Sources and review date
152-FZ: official text hosted by the Ministry of Labour, Articles 3, 5, 6 and 9. Source reviewed on 2026-10-06. Its amendment list ends at 2025-06-24; subsequent official amendments need checking before applying a provision. This course does not label the page a complete consolidated edition for the review date.
Python on Windows: official setup instructions.
Which data does this task require
Change the conditions and observe this training model. It runs in your browser and does not change your computer.
In this training form, purpose determines the fields. An account needs email and a display name; shipping a printed guide needs a name, contact email and address. These are example rules; justify every real product field separately.
Choose conditions above to see an explanation of the result.
Independent exercise · Russian

Мастерская в Перми вводит предварительную запись на бесплатную диагностику в декабре 2026 года. На стойке посетитель сам показывает код записи. Напоминание по телефону предлагают только по его желанию.
Evidence
В макете пять обязательных полей: время визита, фамилия, телефон, домашний адрес и дата рождения. Код создаётся системой. Приёмщик находит бронь по коду, мастер видит занятый час. Отдельно отдел продаж хочет пригласить посетителей на выставку.
Assignment
Нарисуйте сокращённую форму и две версии карточки брони: с напоминанием и без него. Запишите, кто определяет цель использования телефона, и объясните, как оформить вопрос об отдельной рассылке.
Compare your reasoning
Для самой записи посетитель выбирает свободное время и получает код. Фамилия, домашний адрес и день рождения в описанном процессе не используются. Телефон появляется при выборе напоминания и доступен сотруднику, который его отправляет. Оператор отдельно определяет и проверяет основание для каждого использования. Проверьте, что бронь оформляется без телефона и что выбор напоминания не создаёт запись в списке приглашённых на выставку.
Personal practice environment
Check an excerpt, find matching lines and compute the SHA-256 of the original text. Temporary data expires after 30 minutes or when you close the environment.
Sign in