Policy Enforcement with Proactive Libraries