# Security & Privacy

## Connection string sanitization

When parsing connection strings, `excelminer` sanitizes a small set of sensitive key/value pairs before storing them in graph attributes.

Currently sanitized keys include (case-insensitive):

- `password`
- `pwd`
- `user id`
- `uid`

Sanitized values are replaced with `"***"`.

Important:

- The sanitized form is stored in `connection.attrs.connection_kv`.
- The original raw connection string may also be stored in `connection.attrs.raw`.

If you are processing sensitive workbooks, treat the entire output as sensitive:

- Prefer `AnalysisOptions(include_connections=False)` when you do not need connection metadata.
- Or post-process the JSON to remove/redact `connection.attrs.raw` before sharing.

## What is stored

- `excelminer` stores workbook metadata and formula text.
- `excelminer` does not attempt to execute macros.
- `excelminer` does not evaluate formulas.

## COM automation notes

If you enable Excel COM automation:

- Excel is started in the background.
- Workbooks are opened read-only.
- Even in read-only mode, some enterprise Excel environments can display prompts or behave unexpectedly.

If you are processing sensitive workbooks, consider running in an isolated environment and reviewing the produced JSON before sharing it.

## Limitations & risk notes

- Sanitization only covers a small set of known keys. Connection strings can contain credentials under other key names.
- Power Query M code (when present) can embed URLs, file paths, server names, or credentials. Treat extracted `powerquery.m_code` as sensitive.
- COM automation interacts with a real Excel instance. Even with macros disabled and read-only open, behavior can vary by environment (prompts, add-ins, policies).
