Join our Newsletter — 33% off our NHI Course
Home› Glossary› Cyber Security› Readonly Proxy
Cyber Security

Readonly Proxy

← Back to Glossary
By NHI Mgmt Group Updated November 19, 2026 Domain: Cyber Security

A readonly proxy is a wrapper that prevents direct property assignment while still allowing access to forwarded methods. It can reduce accidental modification, but it does not stop a method from changing host state once the call reaches the underlying object. That distinction is central in sandbox containment failures.

How a readonly proxy works

A readonly proxy sits between a caller and an underlying object, exposing the object through a wrapper that blocks direct property writes while still forwarding allowed access. That makes it useful for reducing accidental mutation, but it is not a deep immutability boundary.

The key design point is that the wrapper governs the proxy interface, not the internal behaviour of the target. A proxy can reject assignment at the surface and still permit a method call that updates state inside the wrapped object.

Why readonly proxies can still allow state changes

Readonly proxies are often misunderstood as a guarantee that an object cannot change. In practice, they only constrain one route to mutation, so method calls, callbacks, shared references, and internal side effects can still alter host state if the underlying object is written to elsewhere.

This distinction matters because the security property being enforced is narrower than "no change at all". If a component assumes the wrapper makes the target safe to share across trust boundaries, the assumption can fail even though direct assignment is blocked.

Where readonly proxies fit in containment and sandboxing

In containment-oriented designs, a readonly proxy can reduce casual tampering with exposed objects, configuration views, or host APIs. It is best treated as a guardrail for object access, not as a complete isolation mechanism.

That means the surrounding API design still has to account for mutation through methods, object aliasing, and any state that lives outside the proxy boundary. The wrapper may shape how code reaches the target, but it does not by itself stop all write effects.

For developers comparing object wrapper patterns, the security expectation should stay aligned with the actual contract. A readonly proxy can make an interface safer to use, but only if the underlying object model and method surface were designed with that limitation in mind.

What to watch for in proxy-based interfaces

Readonly proxies become fragile when code treats a read-only surface as equivalent to an immutable object. The common failure mode is assuming that blocked property assignment also blocks method-driven side effects, which can leave hidden mutation paths open.

Any design that exposes shared state through forwarded methods should be reviewed for whether the method set itself can modify data, trigger cascading changes, or reveal mutable references that bypass the proxy contract.

Practitioner Guidance

Common misunderstanding: A readonly proxy is not an immutability boundary, so do not use it as the only control when the security or correctness requirement is that state must not change. Treat the proxy as one enforcement layer and verify whether methods, nested objects, and shared references still allow mutation.

What to watch for: Review the target API for side effects before relying on a readonly wrapper in a sandbox, plugin host, or capability-limited interface. If a method can mutate host state, the wrapper preserves access control at the surface but not containment of behaviour.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 19, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org