1. A method comprising: detecting, by a computer system, occurrence of a runtime event at a web service endpoint; updating, by the computer system, a runtime context component based on the runtime event, the runtime context component specifying a set of data regarding a current runtime context of the web service endpoint; determining, by the computer system based on the runtime context component and an association between a web service policy and a constraint expression, whether the web service policy should be attached to the web service endpoint, the constraint expression being dependent on one or more runtime values specified by the runtime context component, the determining comprising evaluating the constraint expression in view of the one or more runtime values; and if the web service policy should be attached to the web service endpoint, enforcing, by the computer system, the web service policy at the web service endpoint with respect to the detected runtime event.