# Safe Library Imports

**URL:** <https://internals.rust-lang.org/t/safe-library-imports/9320>\
**Category:** language design\
**Created:** [February 1, 2019, 1:38pm UTC](https://internals.rust-lang.org/t/safe-library-imports/9320 "2019-02-01T13:38:56Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Ixrec](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/ixrec/32/6754_2.png) [@Ixrec](https://internals.rust-lang.org/u/Ixrec)\
**Post date:** [February 1, 2019, 2:27pm UTC](https://internals.rust-lang.org/t/safe-library-imports/9320/4 "2019-02-01T14:27:43Z")

</div>

Ideas like this come up semi-regularly. My current understanding is that:

> [@mcy](#):
>
> Enforcing this seems spectacularly hard.

> [@Safe Rust (sandboxing untrusted modules at API level)](https://internals.rust-lang.org/t/safe-rust-sandboxing-untrusted-modules-at-api-level/1505/3):
>
> Even if we could come up with a safe subset, a system like this would introduce a false sense of security. Just because some code can’t do anything malicious itself doesn’t mean that it can’t cause code that relies on it to do something unintended.

> [@Safe Rust (sandboxing untrusted modules at API level)](https://internals.rust-lang.org/t/safe-rust-sandboxing-untrusted-modules-at-api-level/1505/4):
>
> What we _really_ need is an easy to use, cross platform sandboxing solution.

Most recent threads about this seem to be focused on sandboxing _build scripts_ in particular, though from what little I know the issues there seem very similar to runtime sandboxing.

The [Rust Secure Code Working Group](https://github.com/rust-secure-code/wg) has seemingly active issues on [Build-time sandboxing](https://github.com/rust-secure-code/wg/issues/29), [Safety-oriented static analysis tooling](https://github.com/rust-secure-code/wg/issues/22), [Reduce the use of `unsafe` in the ecosystem](https://github.com/rust-secure-code/wg/issues/19) and so on, which imo are more cost-effective/less ecosystem-splitting solutions for improving our overall security than a language-level feature.

---

_[View the full topic](https://internals.rust-lang.org/t/safe-library-imports/9320)._
