Unfortunately, this is not possible at this time.
Could you please elaborate on the security policy you're referring to. The API already supports ArcGIS Server security model (Basic/Digest/Token).
If we have more information about your needs we can try and suggest ways to meet them or build provisions in the API for a future release.