Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › AI agents

Put Your AI Agent on a Company Domain: DNS, HTTPS, SSO, and Security Guide

By Freedom251 Team · · 15 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Host an AI agent on a company-owned subdomain such as ai.example.com. First choose where the agent loop and conversation state will run; then obtain TLS certificates, add the platform’s custom-domain DNS record, update OAuth/OIDC callbacks and sign-out URLs, configure exact browser origins, and place an identity-aware access layer in front of the endpoint. OpenAI domain verification is a separate TXT-record check that proves control of a domain for identity settings. It does not host an agent, route traffic, or turn on single sign-on.

What does it mean to put an AI agent on your company’s domain?

A custom domain is the public hostname through which users and software reach your agent. The hostname can front a web chat, an API, or both, while the agent’s model calls, tools, session store, approvals, and logs run in a managed service or in infrastructure your application controls.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For most organizations, a dedicated subdomain is the cleanest boundary. Use a name such as ai.example.com or agent.example.com rather than placing the agent at the root of the corporate site. A separate origin makes DNS, certificates, cookies, browser permissions, access policies, and rollback easier to reason about. If a public website embeds the agent, decide whether the website, the browser API, and an administrative console need separate hostnames; they often should not share the same credentials or cookie scope.

The domain itself does not make the agent trustworthy. It is only the address and trust boundary. Identity enforcement, scoped credentials, logging, rate limits, and an owner for certificates and DNS determine how safely that address can be used.

Which agent architecture should you choose before configuring DNS?

Pick the runtime and hosting boundary before you create records. The hostname must ultimately resolve to the component that terminates TLS and knows how to forward requests to the agent.

Managed Agents API

A managed Agents API keeps more of the runtime infrastructure with the provider. This can reduce the amount of deployment and scaling work your team performs, but you still need to understand how the service handles sessions, tools, approvals, logs, data location, and custom hostnames. Confirm that the provider supports the hostname and authentication pattern you need before committing to the DNS design.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Application-controlled Agents SDK

An application using an Agents SDK runs the agent loop under your deployment boundary. Your team chooses where state is stored, how tools are executed, how approvals are recorded, and how the service is integrated with existing observability and release processes. The custom domain normally points to your gateway, load balancer, or application ingress.

Direct Responses API integration

A direct Responses API integration leaves more of the loop and state management to your application. This offers control over orchestration and data flows, but your team must implement the surrounding behavior: conversation persistence, retries, tool dispatch, approval gates, streaming, and operational safeguards.

Decision axis Managed Agents API Agents SDK in your application Direct Responses API
Who runs the agent loop? Provider-managed service, subject to its runtime model Your deployed application Your application and orchestration code
Where does conversation state live? Provider-defined or configured storage; verify the service terms Storage selected and operated by your team Storage and retention logic implemented by your team
Tools and approvals Use the provider’s supported mechanisms Implement and govern them in your application Implement dispatch, approval, retries, and auditing yourself
Custom hostname and TLS Depends on the service’s custom-domain feature Normally handled by your ingress, gateway, or CDN Handled by your ingress, gateway, or CDN
SSO, MFA, and audit integration Depends on provider and an identity-aware proxy Can be integrated with your existing identity stack Can be integrated with your existing identity stack
Browser CORS and streaming Confirm provider behavior and allowed origins Configure at your gateway and application Configure at your gateway and application

Evaluate each option against the same questions: who owns the agent loop, where state is stored, how tools and approvals execute, whether custom hostnames and TLS are native, how SSO and audit logs connect, whether streaming and browser CORS work, how you roll back, where data resides, and what the total operating cost will be. Do not choose a runtime solely because it offers a convenient default URL.

How do you choose the hostname and trust boundaries?

Reserve the hostname before requesting certificates or changing application settings. Keep production and non-production names distinct, for example ai.example.com and ai-staging.example.com, so a test deployment cannot receive production cookies or tokens.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Web chat: Use a hostname intended for interactive users, with a browser session policy and an identity provider.
  • Programmatic API: Use a hostname whose clients authenticate with scoped tokens or workload identity rather than browser cookies.
  • Embedded widget: Treat the site that embeds the widget as a separate browser origin. Record its exact scheme, host, and port for CORS.
  • Administration: Put dashboards, tool configuration, and prompt management on a separate restricted hostname whenever the platform permits it.

Write down which component owns each boundary: DNS, certificate renewal, edge routing, authentication, session storage, tool execution, secrets, logs, and incident response. A custom hostname is production infrastructure, not merely a branding change.

How do you point DNS and HTTPS to an AI agent?

Use this sequence so that the hostname, certificate, identity settings, and application agree before users arrive.

  1. Choose the hostname. Select ai.example.com or a similar dedicated subdomain. Decide whether the public site, an embedded client, and an API will use separate origins.
  2. Choose the runtime and hosting boundary. Decide whether the managed service, your application server, a gateway, a CDN, or a platform deployment receives the request first. Record where sessions, tools, approvals, logs, and secrets will live.
  3. Request certificates for every name. Obtain certificates that cover each production and staging hostname. The ESP Private Agents guidance requires certificates for separate dashboard and API subdomains and notes that certificate region can matter when a CDN such as CloudFront is involved. Make the certificate’s names match the hostname exactly; a certificate for the parent domain is not automatically a substitute for every subdomain.
  4. Enable the platform’s custom-domain setting. In Cloudflare’s AI Gateway dashboard, the documented path is AI > AI Gateway > gateway > Domains > Add Domain. Its API flow returns a CNAME target. Other platforms expose an equivalent custom-domain or ingress setting.
  5. Publish the DNS record. Add the CNAME, ALIAS, or platform-specific record that points the hostname to the gateway, CDN, load balancer, or application target. If the platform requires a proxied record, use that mode; do not substitute an arbitrary target. Keep the old hostname available until the new route has passed testing.
  6. Wait for DNS and certificate validation. Check that public resolvers return the intended target and that the edge presents a certificate containing the requested hostname. DNS propagation and certificate issuance can complete at different times.
  7. Update identity settings. Replace old-host callback and sign-out URLs in your OAuth or OIDC client with the new HTTPS hostname. The ESP Private Agents documentation specifically warns that leaving Cognito callback URLs on the old host causes sign-in redirects to fail. Update every environment and every client that can initiate a login.
  8. Set exact browser origins. For an embedded agent or browser API, allow each exact scheme://host[:port] origin. Credentialed CORS should not use a wildcard. ESP Private Agents states that wildcard origins are unsupported for credentialed CORS and that origin changes take effect on the next deployment.
  9. Put identity-aware access in front. Attach an access proxy or equivalent policy to the hostname. Require MFA or conditional access for sensitive agents, restrict groups or service identities, and keep model and tool credentials outside browser code.
  10. Run operational tests and cut over gradually. Test resolution, TLS, redirects, login return paths, CORS preflight, streaming, tool callbacks, rate limits, logs, and rollback. Switch users or DNS traffic only after the new path behaves correctly.

What DNS record should the custom domain use?

The platform determines the record type and target. A CNAME is common for a subdomain because it delegates the hostname to a gateway or CDN. Some providers require an ALIAS or another platform-specific record, particularly at an apex domain. Use the exact value returned by the platform rather than guessing a gateway address.

Cloudflare describes custom domains as a way to send AI Gateway requests through a hostname you own, such as ai.example.com, instead of the default gateway.ai.cloudflare.com endpoint. The same custom-domain configuration is the foundation for Cloudflare Access identity controls. If you use the Cloudflare API flow, publish the returned CNAME target as the required proxied DNS record.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check the result from more than one public resolver and from the network where your users work. Internal split-horizon DNS can make a hostname appear correct inside the office while external users receive a different answer. Keep the previous record documented so a rollback can be made without reconstructing the old route.

How do TLS certificates, redirects, and host headers affect the setup?

Serve the agent only over HTTPS in production. The certificate must include the exact hostname users enter, and the edge must pass the intended host information to the gateway or application. Redirect an HTTP request to HTTPS before authentication where possible, while avoiding redirect loops between the CDN and origin.

When a CDN or load balancer terminates TLS, confirm whether the origin also requires HTTPS and which forwarded-protocol headers it trusts. A mismatch can produce endless redirects, rejected webhooks, or callbacks that return to an HTTP URL. If separate dashboard and API subdomains are required, issue and renew certificates for both; do not assume one certificate request covers names the platform treats independently.

Certificate ownership should be explicit. Give the DNS or platform team a renewal alert and an emergency contact, and test renewal in a non-production environment. A valid certificate that is allowed to expire is an operational failure, not an application bug.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do authentication callbacks and CORS work on the new hostname?

Authentication providers compare callback URLs literally. Add the complete HTTPS URL, path, and—where the provider requires it—port to the OAuth or OIDC client. Update sign-out and post-logout URLs as well as login callbacks. If several applications use the same identity provider, change only the clients that should accept the new hostname.

For browser calls, CORS is an origin allowlist, not a hostname pattern. An origin includes the scheme, host, and port but not a path. For example, https://app.example.com and https://app.example.com:8443 are different origins, as are HTTP and HTTPS. Allow only the origins that actually embed or call the agent, return the required headers, and handle the preflight method and headers used by your client.

Do not combine wildcard origins with cookies or other credentials. If the platform applies CORS settings at deployment time, schedule a deployment after changing the list and verify the response from a real browser. Keep the API origin separate from administrative pages so a mistake in one allowlist does not expose the other.

Does verifying your domain with OpenAI host the agent?

No. OpenAI’s domain-verification flow asks an administrator to publish a public DNS TXT record and then select Check Domain. OpenAI says that verification confirms control of the domain for identity settings; it does not by itself enable SSO, configure SCIM, or grant product access.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Verification and hosting are separate tracks. A verified example.com does not create ai.example.com, issue its certificate, route requests, configure your gateway, or change OAuth callbacks. You still need the custom-domain setting, DNS record, TLS, application authentication, browser-origin policy, and access controls described above.

How should you secure an agent exposed on a company domain?

Assume that the hostname will be discovered and probed. Protect the route as a production service even if the agent is intended for employees only.

  • Use an identity-aware proxy. Cloudflare Access or an equivalent layer can require identity, group membership, MFA, device posture, or conditional rules before a request reaches the agent. Cloudflare’s AI-wrapper pattern attaches a Worker to a custom domain and creates a self-hosted Access application for that hostname.
  • Apply least privilege. Give the agent only the model, database, API, and tool permissions it needs. Separate read and write credentials, set expirations where possible, and make revocation a documented operation.
  • Keep secrets server-side. Never embed provider keys, tool tokens, or administrative credentials in JavaScript delivered to the browser. Use a server-side session or a short-lived, audience-restricted token.
  • Log decisions and actions. Capture authenticated identity, request ID, model and tool calls, approval decisions, policy denials, latency, and errors. Redact sensitive prompt and response content according to your retention policy.
  • Rate-limit by identity and route. Apply separate limits to interactive users, service clients, tool callbacks, and unauthenticated probes. Set maximum request size and timeout values at the edge and in the application.
  • Separate environments. Use different hostnames, credentials, data stores, and identity groups for staging and production. Do not point a test hostname at production tools.
  • Assign ownership. Name a DNS owner, certificate owner, identity owner, and application owner. Record who can approve changes and who can revoke access during an incident.

For agent-operated domain changes, use narrowly scoped permissions. Custom-domain guidance describes separate grants such as domains:read, domains:connect, domains:disconnect, and domains:purchase, with owner-controlled revocation. It also recommends computing DNS values rather than accepting arbitrary record input. Those principles apply even when a human, rather than an agent, performs the change.

What should you test before announcing the hostname?

Run the checks from a user network and from the systems that will call the API. Record the expected result and the observed result so a later incident can be compared with the original cutover.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • DNS: The hostname resolves to the intended gateway, CDN, load balancer, or application target from public resolvers.
  • TLS: The certificate is valid, unexpired, issued for the exact hostname, and presented on every edge used by the service.
  • HTTP behavior: HTTP redirects to HTTPS once, the canonical host is preserved, and health checks do not require an interactive login unless intentionally designed that way.
  • Authentication: Login returns to the new callback, logout returns to the approved destination, and an unauthorized user is denied before reaching agent tools.
  • CORS: An allowed origin succeeds, an unlisted origin fails, and credentialed requests never receive a wildcard origin.
  • Streaming: Tokens or events arrive incrementally rather than being buffered until the response ends; proxy timeouts and idle limits are long enough for expected turns.
  • Tools and callbacks: Outbound tool calls reach the correct environment, callback signatures validate, retries are bounded, and approvals are recorded.
  • Abuse controls: Rate limits, request-size limits, token budgets, and timeout behavior produce a controlled error rather than an unbounded run.
  • Observability: Logs contain a correlation ID and authenticated principal without exposing secrets, and alerts fire for certificate, DNS, authentication, and elevated error conditions.
  • Rollback: The previous hostname or route remains documented and can be restored without deleting the new configuration.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What commonly breaks, and how do you fix it?

Symptom Likely cause Fix
“This site can’t be reached” or an old service appears Wrong record, unpropagated DNS, or a resolver cache Compare the published record with the platform’s target, query multiple public resolvers, and wait for the configured TTL before changing more settings.
Certificate name mismatch The certificate omits the new subdomain or the edge serves a default certificate Issue a certificate containing the exact hostname and bind it to the listener that receives the request.
Login succeeds but returns an error OAuth/OIDC callback or sign-out URL still references the old host Add the complete new HTTPS URL to the correct client and deploy the updated application configuration.
Browser reports a CORS error The precise scheme, host, or port is absent, or the new list has not been deployed Add the exact origin, remove wildcard credentials, deploy the change, and repeat the preflight test.
Streaming arrives all at once A proxy buffers the response or closes an idle connection Disable response buffering for the streaming route where supported and adjust read, idle, and origin timeouts.
Tools work in staging but fail in production Callback URL, secret, network route, or environment allowlist still points to staging Trace the request with a correlation ID and verify every environment-specific endpoint and credential.
Access policy is bypassed The origin is reachable directly or a second hostname lacks the same policy Restrict origin ingress to the proxy, apply the policy to every public hostname, and rotate credentials exposed by the bypass.
DNS changes are hard to reverse No record of the previous target or no owner with authority to change it Keep a change record, preserve the prior value until cutover is proven, and assign an on-call DNS owner.

How do you operate the domain after launch?

Review the hostname as part of normal service management. Monitor certificate expiry and renewal, DNS changes, authentication failures, denied access, CORS errors, latency, streaming disconnects, tool failures, and rate-limit events. Revalidate the route after every gateway, CDN, identity-provider, or DNS change.

Rotate service credentials on a schedule and after personnel or vendor changes. Remove unused callback URLs and browser origins; stale entries broaden the attack surface and make incident review harder. Keep a tested rollback path and a short runbook containing the platform’s custom-domain procedure, DNS target, certificate location, identity clients, access policy, owners, and escalation contacts.

If an agent can change DNS or domains, require an approval step for connect, disconnect, and purchase actions, log the actor and computed record values, and make revocation immediate. A human-readable name does not replace change control.

Frequently asked questions

Can I use the company’s root domain instead of a subdomain?

Sometimes, but an apex domain may require an ALIAS or provider-specific record because standard DNS does not allow a normal CNAME at the root. A dedicated subdomain also avoids colliding with the corporate website and limits cookie, routing, and access-policy scope, so it is usually the safer default.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Will adding a CNAME take down my existing company website?

Adding a record for ai.example.com does not change www.example.com or the apex record. An outage is more likely when someone edits the existing website record, points the new name at the wrong target, or changes a shared CDN configuration without testing.

Why does an agent work in a browser but fail for an API client?

Browser sessions may use cookies and an interactive identity flow, while API clients need a token with the right audience, scope, and expiration. Check the client’s authorization header, gateway policy, clock skew, and whether the API route is distinct from the browser route.

How can I prevent a reverse proxy from breaking long agent runs?

Set compatible connection, read, and idle timeouts at every hop, and ensure streaming responses are not buffered. Send the platform’s supported keep-alive or event signals, then test a deliberately long run through the same proxy path used in production.

Who should be allowed to change the agent’s domain?

Limit domain connect, disconnect, and purchase permissions to a small group that owns DNS or platform operations, with a separate approval for production changes. Keep application developers able to deploy code without automatically granting them authority to redirect the company’s hostname.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Can I use the company’s root domain instead of a subdomain?

Sometimes, but an apex domain may require an ALIAS or provider-specific record because standard DNS does not allow a normal CNAME at the root. A dedicated subdomain also avoids colliding with the corporate website and limits cookie, routing, and access-policy scope, so it is usually the safer default.

Will adding a CNAME take down my existing company website?

Adding a record for ai.example.com does not change www.example.com or the apex record. An outage is more likely when someone edits the existing website record, points the new name at the wrong target, or changes a shared CDN configuration without testing.

Why does an agent work in a browser but fail for an API client?

Browser sessions may use cookies and an interactive identity flow, while API clients need a token with the right audience, scope, and expiration. Check the client’s authorization header, gateway policy, clock skew, and whether the API route is distinct from the browser route.

How can I prevent a reverse proxy from breaking long agent runs?

Set compatible connection, read, and idle timeouts at every hop, and ensure streaming responses are not buffered. Send the platform’s supported keep-alive or event signals, then test a deliberately long run through the same proxy path used in production.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Who should be allowed to change the agent’s domain?

Limit domain connect, disconnect, and purchase permissions to a small group that owns DNS or platform operations, with a separate approval for production changes. Keep application developers able to deploy code without automatically granting them authority to redirect the company’s hostname.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

AI agentsCloudflareCORScustom domainsDNSHTTPSOAuthOpenAI

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.