I knew that the GoldenGate 26ai AI Service keeps the API key of a provider in a wallet. What I did not expect is that the key also leaks into restapi.log, in clear text. It is also written to the system security log, /var/log/secure. I saw it on 23.26.4.0.0 and 23.26.4.0.2. Here is what you should do.
Provider registration in the web UI
I registered a Gemini provider with the fake key FAKEKEY-LAB-123456. The Add Provider dialog of the AI Service page masks the key while I type it:

The browser sends the key in the body of a POST request on /services/v2/installation/aiservice/providers/gemini:
{
"id": "gemini",
"name": "GeminiAiStudio",
"type": "gemini",
"baseUrl": "https://generativelanguage.googleapis.com/v1beta",
"authentication": {
"secret": "FAKEKEY-LAB-123456"
}
}
Key storage
Provider configuration
First, let’s see how all of this AI Service registration is handled in GoldenGate 26ai. When registering a new provider, it is added to $OGG_SM_HOME/var/lib/conf/global.dat, in the Service Manager. The authentication block of the new provider is empty:
Questions about your own setup? A dbi services consultant can look at your case.
Talk to an expert (opens in a new tab)$ jq '.global.configData["ogg:aiserviceCollection"].values.providers.items[] | select(.id == "gemini")' $OGG_SM_HOME/var/lib/conf/global.dat
{
"authentication": {},
"name": "GeminiAiStudio",
"type": "gemini",
"baseUrl": "https://generativelanguage.googleapis.com/v1beta",
"id": "gemini"
}
REST API installation/aiservice/providers endpoint
The REST API returns the provider without its key. Only the information that a key exists is returned. I call it with the Python requests module, from a session that sends my credentials:
>>> import requests
>>> sm = requests.Session()
>>> sm.auth = ("ogg", "***")
>>> url = "http://localhost:7840/services/v2"
>>> sm.get(f"{url}/installation/aiservice/providers/gemini").json()["response"]
{'id': 'gemini', 'name': 'GeminiAiStudio', 'type': 'gemini', 'baseUrl': 'https://generativelanguage.googleapis.com/v1beta', 'authentication': {'type': 'api_key', 'configured': True}, '$schema': 'ogg:provider'}
Deployment wallet
As expected, the key goes to the wallet ewallet.p12, in the directory $OGG_SM_HOME/var/lib/credential/secureStore of the Service Manager. Here is the wallet before the registration:
$ ls -l $OGG_SM_HOME/var/lib/credential/secureStore/ewallet.p12
-rw-r-----. 1 oracle oinstall 611 Nov 22 15:30 /u01/app/ogg/deployments/oggresetsm/var/lib/credential/secureStore/ewallet.p12
After the registration, the wallet is bigger:
$ ls -l $OGG_SM_HOME/var/lib/credential/secureStore/ewallet.p12
-rw-r-----. 1 oracle oinstall 819 Nov 22 15:33 /u01/app/ogg/deployments/oggresetsm/var/lib/credential/secureStore/ewallet.p12
AIService.log names the entry of the wallet. The key is <provider id>:secret:
$ grep gemini $OGG_SM_HOME/var/log/AIService.log
[...]
2026-11-22T15:33:55.454+0000 DEBUG|AIService |AIService | 633 ModelCatalogAdapter.cpp | putInSecureStore: [enter]: key: gemini:secret (Thread 2)
2026-11-22T15:33:55.552+0000 INFO |AIService |AIService | 1293 ProvidersEndpoint.cpp | Creating provider 'gemini' (catalog size=1). (Thread 2)
[...]
Key in restapi.log
The wallet is the right place for a secret. However, the key is also in restapi.log, which records every REST API call with its body:
2026-11-22 15:33:55.552+0000 INFO |RestAPI.ServiceManager | Request #47: {
"context": {
"verb": "POST",
"uri": "/services/v2/installation/aiservice/providers/gemini",
"headers": {
"Cookie": "** Masked **"
},
"authorization": {
"authUserName": "ogg",
"authMode": "Cookie"
}
},
"content": {
"id": "gemini",
"name": "GeminiAiStudio",
"type": "gemini",
"baseUrl": "https://generativelanguage.googleapis.com/v1beta",
"authentication": {
"secret": "FAKEKEY-LAB-123456"
}
}
}
The session cookie is masked, so the logger knows how to hide a secret. However, the secret of the provider is not masked.
OCI private key and rejected requests
The OCI Generative AI provider has a privateKey field. I registered it through the REST API with a fake value, and first with a wrong type:
>>> provider = {"name": "OciGenAi", "type": "oci",
... "baseUrl": "https://inference.generativeai.eu-frankfurt-1.oci.oraclecloud.com",
... "authentication": {"type": "api_key",
... "tenancyId": "ocid1.tenancy.oc1..aaaaaaaafake",
... "compartmentId": "ocid1.compartment.oc1..aaaaaaaafake",
... "userId": "ocid1.user.oc1..aaaaaaaafake",
... "keyFingerprint": "aa:bb:cc:dd:ee:ff:00:11:22:33:44:55:66:77:88:99",
... "privateKey": "FAKEOCIKEY-REJECTED-123456"}}
>>> r = sm.post(f"{url}/installation/aiservice/providers/oci", json=provider)
>>> r.status_code, r.json()["messages"][0]["title"]
(400, "The value of property '/type' is not valid")
I then sent it again with the type oci_genai and another fake key, and it was accepted:
>>> provider["type"] = "oci_genai"
>>> provider["authentication"]["privateKey"] = "FAKEOCIKEY-ACCEPTED-123456"
>>> r = sm.post(f"{url}/installation/aiservice/providers/oci", json=provider)
>>> r.status_code, r.json()["response"]["type"]
(201, 'oci_genai')
Both private keys are in the log. It does not matter whether the key was accepted or not, a request that the REST API rejects is logged with its secret.
$ grep FAKEOCIKEY $OGG_SM_HOME/var/log/restapi.log
"privateKey": "FAKEOCIKEY-REJECTED-123456"
"privateKey": "FAKEOCIKEY-ACCEPTED-123456"
Reducing the exposure
In a previous blog, I went through GoldenGate log retention and the XML files behind it. To remove a key from the active restapi.log, there is no need to change them. A DELETE call on /services/v2/logs/restapi rotates the log:
>>> sm.delete(f"{url}/logs/restapi").json()
{'$schema': 'api:standardResponse', 'links': [{'rel': 'canonical', 'href': 'http://localhost:7840/services/v2/logs/restapi', 'mediaType': 'application/json'}, {'rel': 'self', 'href': 'http://localhost:7840/services/v2/logs/restapi', 'mediaType': 'application/json'}], 'messages': []}
The key is now in restapi.log.1, and the new restapi.log does not contain it. You can then move the old file to a protected location, or delete it:
$ grep -l FAKEKEY-LAB-123456 $OGG_SM_HOME/var/log/restapi.log*
/u01/app/ogg/deployments/oggresetsm/var/log/restapi.log.1
$ mv $OGG_SM_HOME/var/log/restapi.log.1 /tmp/restapi.log.with-key
$ grep -l FAKEKEY-LAB-123456 $OGG_SM_HOME/var/log/restapi.log*
Another (unofficial) way is to just spam the web UI or the adminclient with commands / clicks until the restapi.log file rotates automatically, which should not take too long.
Key in /var/log/secure
restapi.log is not the only copy. GoldenGate also audits the REST API requests, and sends the audit to the system security log. On Oracle Linux, this is /var/log/secure. The destination is set in $OGG_HOME/lib/utl/logging/ogg-audit.xml:
$ grep appender-ref $OGG_HOME/lib/utl/logging/ogg-audit.xml
!- "appender-ref" at the end of this file. -|
<appender-ref name="audit.Standard"/>
And in /var/log/secure, the key is also leaked:
$ grep FAKEKEY-LAB-123456 /var/log/secure
Nov 22 15:33:55 ogg26-cdb ServiceManager[15184]: 2026-11-22T15:33:55.460+0000 INFO | 69 {#012 [...] "uri": "/services/v2/installation/aiservice/providers/gemini", [...] "authentication": {#012 "secret": "FAKEKEY-LAB-123456"#012 }#012 },#012 "isScaRequest": true#012 }
If your server forwards the file to another location, the key might leave the machine.
Summary
- The API key of a provider is saved in the wallet
ewallet.p12of the Service Manager as<provider id>:secret. It is not inglobal.datand the REST API never returns it. - The request that registers the provider is logged in
restapi.logwith the key in clear text, from the web UI as well as from the REST API. - Rejected requests are logged too.
- Rotate
restapi.logwith aDELETEcall on/services/v2/logs/restapi, then move or deleterestapi.log.1. - The request is also written with the key to
/var/log/secureby the audit configured inogg-audit.xml. - Check who can read these files before you send logs to a third party. Change the key at the provider if it may have been read.