endpoint security entitlements error

I'm trying to build an endpoint security app following the sample code of WWDC 2020(https://developer.apple.com/documentation/endpointsecurity/monitoring_system_events_with_endpoint_security) However when I had successfully installed the extension and tried to launch that,I found it doesn't work.Then I checked the launched.log and found the following errors: 7ALSB95525.com.example.apple-samplecode.SampleEndpointApp7ALSB95525.Extension [65936]) : xpcproxy exited due to OS_REASON_CODESIGNING | When validating /Library/SystemExtensions/9DCE301A-51EB-4737-946A-7587531FAE6E/com.example.apple-samplecode.SampleEndpointApp7ALSB95525.Extension.systemextension/Contents/MacOS/com.example.apple-samplecode.SampleEndpointApp7ALSB95525.Extension: Code has restricted entitlements, but the validation of its code signature failed. Unsatisfied Entitlements: 2022-07-07 14:07:58.187530 (system/7ALSB95525.com.example.apple-samplecode.SampleEndpointApp7ALSB95525.Extension [65936]) : removing service since it exited with consistent failure - OS_REASON_CODESIGNING | When validating /Library/SystemExtensions/9DCE301A-51EB-4737-946A-7587531FAE6E/com.example.apple-samplecode.SampleEndpointApp7ALSB95525.Extension.systemextension/Contents/MacOS/com.example.apple-samplecode.SampleEndpointApp7ALSB95525.Extension: Code has restricted entitlements, but the validation of its code signature failed. Unsatisfied Entitlements: 2022-07-07 14:07:58.187538 (system/7ALSB95525.com.example.apple-samplecode.SampleEndpointApp7ALSB95525.Extension [65936]) : exited with exit reason (namespace: 3 code: 0x1) - OS_REASON_CODESIGNING | When validating /Library/SystemExtensions/9DCE301A-51EB-4737-946A-7587531FAE6E/com.example.apple-samplecode.SampleEndpointApp7ALSB95525.Extension.systemextension/Contents/MacOS/com.example.apple-samplecode.SampleEndpointApp7ALSB95525.Extension: Code has restricted entitlements, but the validation of its code signature failed. Unsatisfied Entitlements: 2022-07-07 14:07:58.187545 (system/7ALSB95525.com.example.apple-samplecode.SampleEndpointApp7ALSB95525.Extension [65936]) : internal event: INIT, code = 153 2022-07-07 14:07:58.187554 (system/7ALSB95525.com.example.apple-samplecode.SampleEndpointApp7ALSB95525.Extension [65936]) : service state: exited

It seems to be sth with entitlements.Since I don't have the Endpoint Security Entitlement,I turned off the System Integrity Protection with the following instruction(https://developer.apple.com/system-extensions/) which says that I can test system extensions on my Mac by temporarily turning off System Integrity Protection. However,it didn't work and the error still exists. Does Anyone know what I should do to figure it out? Thanks a lot!

Oh, wow, two ES questions on the same day! See this thread.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

endpoint security entitlements error
 
 
Q