openai/codex · error · ApiError

cyber policy

Error message

cyber policy: {message}

What it means

The request was rejected by the API's cyber safety policy: the content was classified as potentially harmful cyber activity and the call is refused; the message carries the policy explanation. Used by app-server daemon remote-control platform checks.

Solutions

  1. Adjust the request content per the policy message
  2. Avoid the disallowed operation
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/codex-api/src/error.rs:30 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/a8427ef8ae722666. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/codex-api/src/error.rs:30

    Api { status: StatusCode, message: String },
    #[error("stream error: {0}")]
    Stream(String),
    #[error("context window exceeded")]
    ContextWindowExceeded,
    #[error("quota exceeded")]
    QuotaExceeded,
    #[error("usage not included")]
    UsageNotIncluded,
    #[error("retryable error: {message}")]
    Retryable {
        message: String,
        delay: Option<Duration>,
    },
    #[error("rate limit: {0}")]
    RateLimit(String),
    #[error("invalid request: {message}")]
    InvalidRequest { message: String },
    #[error("cyber policy: {message}")]
    CyberPolicy { message: String },
    #[error("misalignment policy violation: {message}")]
    MisalignmentPolicyViolation { message: String },
    #[error("server overloaded")]
    ServerOverloaded,
}

impl From<RateLimitError> for ApiError {
    fn from(err: RateLimitError) -> Self {
        Self::RateLimit(err.to_string())
    }
}

View on GitHub (pinned to 339751715c)