To inspect or modify InstanceContext objects when they are created, implement the IInstanceContextInitializer interface and use an IContractBehavior to add it to the InstanceContextInitializers property.
There can be any number of context initializers for a service. Typically, the IInstanceContextInitializer is added to attach an extension to the InstanceContext object as a mechanism for passing data throughout an application.
If you want to participate in providing or selecting the InstanceContext object that processes a message, see System.ServiceModel.Dispatcher..::.IInstanceContextProvider.