Skip to content
Detecti.ai

← All articles

· 5 min · by Gardien Security

Is a keyboard hook a keylogger? The question every DPO asks

Every evaluation of a monitoring tool reaches the same point. The vendor says the agent "detects when a user pastes sensitive data into an AI tool". The DPO reads the sentence and asks: to know that someone pasted, the program has to read the keyboard. So is it a keylogger?

The question is legitimate, and the answer needs to be more precise than "trust us".

What a keyboard hook is on Windows

Windows lets a program ask to be notified when a key is pressed, before the key reaches the application in focus. The mechanism is called a low-level keyboard hook. It has existed for decades and is used by mundane things: global shortcuts, accessibility software, keyboard layout switchers, screenshot tools that react to a key.

The hook receives every key event: which key, whether it was pressed or released, and a few flags. What the program does with that event is the program's decision. That is where the difference lives.

What a keylogger does

A keylogger is a program that receives those events and stores all of them. Every letter, every digit, every password, in order, with the window it was typed in. Then it sends the record to someone. The hook is the same. The difference is in what happens next: storing and transmitting.

That is why the phrase "uses a keyboard hook" says nothing on its own. A layout switcher uses one. A keylogger uses one. What separates the two is what comes out of the hook.

What a hook that reacts only to paste produces

There is a third category. A hook that checks every event against a single condition: is this the paste shortcut? If it is not, the event is handed back to Windows without being stored, without being counted, without passing through one more line of code. If it is, the hook produces exactly one piece of information: "a paste happened now".

Nothing else. No key comes out. No text comes out. No sequence of what came before. The program has nowhere to keep that, because the variable does not exist.

Classifying what was pasted happens somewhere else, on the machine and in memory: the clipboard becomes categories (CPF, the Brazilian individual taxpayer ID; card number; credential; source code) and counts, and the text is discarded. What goes up to the server is the categories and the counts.

Note that reading the clipboard does not come from the hook. The hook does not open the clipboard; it only marks the moment of the paste. When the mode is observe only, the agent looks at the clipboard after the paste happens in an AI tool's window. When the company turns on warn or block, the decision has to be ready the instant the shortcut is pressed, so the agent classifies the clipboard every time it changes, including what will never be pasted into an AI. The result is still category and count. When the person types into ChatGPT, the hook keeps no key: to it, each one is just "not the paste shortcut".

How to verify the vendor's claim

A DPO should not accept this design on description alone. There are four checks that fit in a one-hour meeting.

1. Size of the hook's code

The function that receives the key event should be small enough to be read in full, in minutes, by a non-programmer with a programmer sitting next to them. If the vendor needs "a presentation on the architecture" to explain what the hook does, that answer is already a signal.

2. Automated test

Ask for the test that proves the behavior: a sequence of keys is sent to the hook, including letters, digits and the paste shortcut, and the check confirms that the only output was the paste event, with no key recorded. That test should run on every release. If it does not exist, the behavior can change in an update without anyone noticing.

3. What leaves the machine

Ask for the list of fields in the protocol between agent and server. It should fit in a short table: tool, machine, person, event type, categories, counts, size. Then ask for the negative proof: there is no column in the database for text in the clear, and there is a test that rejects any new text field in the protocol. A vendor who can show both has a verifiable answer.

4. Transparency to the employee

Does the agent appear in the list of installed programs with a name and a description? Does it have a tray icon with a link to the policy? A keylogger hides. A compliance tool introduces itself.

What to write in the record of processing

Under the LGPD, the Brazilian data protection law, what matters is purpose and necessity (article 6). The record of processing operations (article 37) can describe it like this: "keyboard hook that reacts exclusively to the paste shortcut; no other key is stored or counted; the clipboard is classified locally and only categories and counts are transmitted". If the description is right, the DPO can defend it; if it is wrong, the test from check 2 shows it. The same wording works in a GDPR record of processing activities.

How Detecti.ai answers

The keyboard hook in the Detecti.ai agent reacts only to the paste shortcut (Ctrl+V or Shift+Insert). No other key is stored or counted. The clipboard is classified on the machine itself, and the server receives categories and counts, not the text. There is no column for content in the clear in the database, and an automated test rejects any new text field in the protocol. The only exception is evidence retention, which ships turned off: if the customer turns it on, the text the policy interrupted is kept encrypted with a key only the customer holds, and the employee is told on the spot and in the tray. The agent appears in the list of programs and keeps a permanent tray icon with a link to the policy. The details are on the privacy page for DPOs.

Read next