A context can only be accessed via a trusted procedure. This proc is specified when the context is created. E.g.

Define proc SetMContext. It serves as the trusted procediure for the context. Only it is allowed to call dbms_session.set_context to set name-values in M_CONTEXT.

Then you issue the following to create the context and bind its trusted procedure to it:
create or replace context m_context using SetMContext;