# is_sensitive_file_path

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/file_ops/is_sensitive_file_path)

Return whether a path points at a credential/secret file.

Best-effort, filename-based, case-insensitive heuristic. It matches `.env`
and its variants (e.g. `.env.local`), well-known credential filenames, and
private-key/keystore suffixes, and is used to suppress diff/content
rendering for those files so their contents are not shown in the terminal
UI or scrollback. It classifies by name only, not content, so
secret-bearing files with unrecognized names still render.

## Signature

```python
is_sensitive_file_path(
    path_str: str | None,
) -> bool
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `path_str` | `str \| None` | Yes | Filesystem path to classify (a display or absolute path). May be `None` or empty. |

## Returns

`bool`

`True` if the basename matches a known credential pattern. A falsy

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/e4c1ffe9ee63d7854147de490ca27495ef157a7b/libs/code/deepagents_code/file_ops.py#L457)