Start with the business purpose, not a list of every field
Ask what the agent needs to answer. A sales assistant may need a customer name and open balance but not a personal phone number, bank account or cost field. Deny unnecessary models first, allow only required fields, then add masks where the workflow needs a stable but protected representation.
A mask is useful when the existence or identity of a value matters but the raw value does not. It is not a reason to expose an entire model that should have been outside the connection scope.
Choose the mask from the task
| Mask | Returned value | Use carefully for |
|---|---|---|
| Full | A hidden marker instead of the original | Values the agent never needs to distinguish |
| Partial | Configured prefix and suffix with the middle obscured | Recognising a known account or contact without returning the complete value |
| Hash | A SHA-256 digest of the value | Testing whether two returned values match without exposing the source text |
Hashing is not encryption and does not make a small or predictable value impossible to guess. Treat the digest as protected data and avoid using it as a public identifier.
Scope rules to the connection that needs them
A rule identifies the model and field, then can optionally narrow itself to one API key, user, Odoo group or company. This supports a strict finance assistant without imposing the same output on a separate, authorised operational workflow.
Review overlapping rules deliberately. The implementation resolves applicable masks for the authenticated key and user; avoid configurations where administrators cannot explain which rule protects a value.
Block inference through the query itself
Returning “***” is not enough if an agent can filter, sort or group on the hidden field. It could ask a sequence of questions and infer the underlying value from counts or order. The module therefore blocks filtering, grouping and sorting on any masked field. Fully hidden fields cannot be selected at all; partial and hashed fields can be returned only in masked form.
These checks include dotted relational paths and the field shapes used by reporting tools. The refusal does not echo the protected field name, because confirming that a fully hidden field exists can itself disclose information.
Test the negative paths
- Read an allowed record and confirm each protected value has the expected mask.
- Try to select a fully hidden field and confirm the request is denied.
- Try filtering, sorting and grouping on partial and hashed fields.
- Test a related field through a dotted path.
- Repeat with a different key, user, group and company to verify rule scope.
Combine these tests with the read-only connection plan in the Claude access guide.
Frequently asked questions
What field-mask types does the KSROlabs MCP module implement?
Full masking returns a hidden marker, partial masking preserves configured leading and trailing characters, and hashing returns a SHA-256 digest. Empty values remain empty.
Can an agent filter or group by a masked field?
No. Filtering, grouping and sorting on masked fields are blocked because those operations could reveal protected values. Fully hidden fields also cannot be read; partial and hashed fields can be selected only as masked output.
Do field masks replace Odoo access rights?
No. Odoo ACLs, record rules and user permissions remain the first boundary. Masks add a narrower output and query rule for the MCP connection.
Continue in this topic
Build a field-level access matrix
List the models, user groups, companies and sensitive fields involved in one AI workflow. We will define what is hidden, partially shown, hashed or excluded.
Review field exposure →