> For the complete documentation index, see [llms.txt](https://docs.megaeth.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.megaeth.com/moss-docs/core-sdk/security.md).

# Security and Integration Notes

MOSS is designed around a hosted iframe model, which gives partner apps a clear separation between application UI and wallet UI.

## Security Model

* The wallet host runs in an iframe appended to the parent document.
* Penpal is configured with an explicit allowed origin based on the selected wallet host.
* The wallet iframe receives feature permissions for clipboard write and public key credential APIs.
* The parent app does not directly handle key material — it requests actions from the hosted wallet surface.

## MOSS UI and Silent Execution

MOSS UI is the approval and security boundary for first-time connect, signing, permission grants, and transactions. Apps shouldn't assume those approval surfaces can be bypassed for first-time actions. Lower-prompt UX comes from Smart Approvals session grants and scoped delegated execution — this is the intended path to reduce friction while preserving explicit user trust boundaries.

Use `silent: true` only after valid permissions exist for the exact `{ to, signature }` scope.

## Partner Best Practices

* Initialise once and keep wallet access behind clear user intent.
* Request only the permissions required for the current feature.
* Explain high-trust actions before opening the wallet.
* Log operational failures, but do not store raw signed payloads unless your backend actually needs them.
* If your app supports multiple networks, make the selected network visible before the wallet flow begins.
* Do not store long-lived session keys or delegated signing credentials in persistent frontend storage.
* Keep permission escalation and sponsorship approval logic on the backend.

{% hint style="warning" %}
Treat the current SDK source as the observed contract for this release line, not a substitute for release-note compatibility guarantees. If your integration depends on exact iframe host behavior or extra query params, coordinate that expectation with MegaETH.
{% endhint %}

For session keys, restrictive permission defaults, and shipping checklists, see [Best Practices](/moss-docs/wallet/best-practices.md). For independent audits of the on-chain account contract, see [Security Audits](/moss-docs/wallet/audits.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.megaeth.com/moss-docs/core-sdk/security.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
