# detect_shadowed_dcode_safe

> **Function** in `deepagents_code`

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

Best-effort `detect_shadowed_dcode` that never raises.

The shadow check only ever runs to decorate an already-successful upgrade,
so a defect in detection — or an unexpected error escaping the narrow
`OSError` guards inside `detect_shadowed_dcode` — must not turn a working
upgrade into a user-facing failure. Any unexpected exception is logged and
treated as "no shadow detected", matching the fail-open bias the detector
already applies internally.

## Signature

```python
detect_shadowed_dcode_safe() -> ShadowedDcode | None
```

## Returns

`ShadowedDcode | None`

Whatever `detect_shadowed_dcode` returns, or `None` if it raised.

---

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