[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6F76SVHQRW52BQC9R61G8J1":3,"skill-same:01M6F76SVHQRW52BQC9R61G8J1":75},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":43,"linkOnly":44,"markdownContent":45,"markdownBody":46,"frontMatter":47,"refName":52,"commitSha":53,"skillDirectory":54,"forksCount":55,"repositoryHtmlUrl":56,"repositoryHomepageUrl":6,"ownerHtmlUrl":57,"ownerBlogUrl":58,"ownerDescription":59,"updatedAt":60,"install":61,"resources":74},"01M6F76SVHQRW52BQC9R61G8J1","guidewire-security-basics",null,"Implement security best practices for Guidewire InsuranceSuite including OAuth2,\nJWT handling, API roles, secure Gosu coding, and data protection.\nTrigger with phrases like \"guidewire security\", \"oauth2 guidewire\",\n\"jwt token\", \"api roles\", \"secure gosu code\", \"guidewire authentication\".","Dicklesworthstone\u002Fpi_agent_rust","Dicklesworthstone","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F35050222?v=4","01M6CG26AR942CSVMN1M5E3DSE","Jeff Emanuel","01M6CG26EPP71PSHW1VDS71121",1992,"MIT","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fguidewire-pack\u002Fskills\u002Fguidewire-security-basics\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],"guidewire security basics","basics","security","curl","for","with","trigger","io","roles","token","edit","write","read","coding","Bash","api","data","data protection","security best practices","best practices","authentication","code","secure","implement","2026-11-10 10:12:30",false,"---\nname: guidewire-security-basics\ndescription: |\n  Implement security best practices for Guidewire InsuranceSuite including OAuth2,\n  JWT handling, API roles, secure Gosu coding, and data protection.\n  Trigger with phrases like \"guidewire security\", \"oauth2 guidewire\",\n  \"jwt token\", \"api roles\", \"secure gosu code\", \"guidewire authentication\".\nallowed-tools: Read, Write, Edit, Bash(curl:*), Grep\nversion: 1.0.0\nlicense: MIT\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\n---\n\n# Guidewire Security Basics\n\n## Overview\n\nImplement comprehensive security for Guidewire InsuranceSuite including OAuth2 authentication, JWT token management, API role configuration, and secure Gosu coding practices.\n\n## Prerequisites\n\n- Access to Guidewire Cloud Console (GCC)\n- Understanding of OAuth2 and JWT concepts\n- Familiarity with Gosu programming\n\n## Authentication Architecture\n\n```\n+------------------+      +------------------+      +------------------+\n|                  |      |                  |      |                  |\n|  Client App      |----->|  Guidewire Hub   |----->|  InsuranceSuite  |\n|  (Frontend\u002FAPI)  |      |  (IdP)           |      |  Cloud API       |\n|                  |      |                  |      |                  |\n+------------------+      +------------------+      +------------------+\n        |                         |                         |\n        |  1. Auth Request        |                         |\n        |------------------------>|                         |\n        |                         |                         |\n        |  2. JWT Token           |                         |\n        |\u003C------------------------|                         |\n        |                         |                         |\n        |  3. API Call + JWT      |                         |\n        |-------------------------------------------------->|\n        |                         |                         |\n        |  4. Validate JWT        |\u003C------------------------|\n        |                         |                         |\n        |  5. Response            |                         |\n        |\u003C--------------------------------------------------|\n```\n\n## Instructions\n\n### Step 1: Secure OAuth2 Implementation\n\n```typescript\n\u002F\u002F Secure token management\ninterface TokenConfig {\n  clientId: string;\n  clientSecret: string;\n  hubUrl: string;\n  scope: string;\n}\n\nclass SecureTokenManager {\n  private token: string | null = null;\n  private tokenExpiry: Date | null = null;\n  private refreshPromise: Promise\u003Cstring> | null = null;\n\n  constructor(private config: TokenConfig) {}\n\n  async getToken(): Promise\u003Cstring> {\n    \u002F\u002F Return cached token if valid\n    if (this.isTokenValid()) {\n      return this.token!;\n    }\n\n    \u002F\u002F Prevent concurrent refresh requests\n    if (this.refreshPromise) {\n      return this.refreshPromise;\n    }\n\n    this.refreshPromise = this.refreshToken();\n    try {\n      const token = await this.refreshPromise;\n      return token;\n    } finally {\n      this.refreshPromise = null;\n    }\n  }\n\n  private async refreshToken(): Promise\u003Cstring> {\n    const response = await fetch(`${this.config.hubUrl}\u002Foauth\u002Ftoken`, {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application\u002Fx-www-form-urlencoded'\n      },\n      body: new URLSearchParams({\n        grant_type: 'client_credentials',\n        client_id: this.config.clientId,\n        client_secret: this.config.clientSecret,\n        scope: this.config.scope\n      })\n    });\n\n    if (!response.ok) {\n      throw new Error(`Token refresh failed: ${response.status}`);\n    }\n\n    const data = await response.json();\n    this.token = data.access_token;\n    \u002F\u002F Set expiry with 60-second buffer\n    this.tokenExpiry = new Date(Date.now() + (data.expires_in - 60) * 1000);\n\n    return this.token;\n  }\n\n  private isTokenValid(): boolean {\n    return this.token !== null &&\n           this.tokenExpiry !== null &&\n           this.tokenExpiry > new Date();\n  }\n\n  \u002F\u002F Securely clear tokens\n  clearTokens(): void {\n    this.token = null;\n    this.tokenExpiry = null;\n  }\n}\n```\n\n### Step 2: JWT Validation\n\n```typescript\n\u002F\u002F Validate JWT tokens (for webhook receivers or internal services)\nimport jwt from 'jsonwebtoken';\nimport jwksClient from 'jwks-rsa';\n\ninterface JWTValidationConfig {\n  issuer: string;\n  audience: string;\n  jwksUri: string;\n}\n\nclass JWTValidator {\n  private jwksClient: jwksClient.JwksClient;\n  private keyCache: Map\u003Cstring, string> = new Map();\n\n  constructor(private config: JWTValidationConfig) {\n    this.jwksClient = jwksClient({\n      jwksUri: config.jwksUri,\n      cache: true,\n      cacheMaxAge: 600000, \u002F\u002F 10 minutes\n      rateLimit: true\n    });\n  }\n\n  async validateToken(token: string): Promise\u003Cjwt.JwtPayload> {\n    const decoded = jwt.decode(token, { complete: true });\n    if (!decoded || !decoded.header.kid) {\n      throw new Error('Invalid token format');\n    }\n\n    const publicKey = await this.getSigningKey(decoded.header.kid);\n\n    return new Promise((resolve, reject) => {\n      jwt.verify(\n        token,\n        publicKey,\n        {\n          issuer: this.config.issuer,\n          audience: this.config.audience,\n          algorithms: ['RS256']\n        },\n        (err, payload) => {\n          if (err) {\n            reject(new Error(`Token validation failed: ${err.message}`));\n          } else {\n            resolve(payload as jwt.JwtPayload);\n          }\n        }\n      );\n    });\n  }\n\n  private async getSigningKey(kid: string): Promise\u003Cstring> {\n    if (this.keyCache.has(kid)) {\n      return this.keyCache.get(kid)!;\n    }\n\n    const key = await this.jwksClient.getSigningKey(kid);\n    const publicKey = key.getPublicKey();\n    this.keyCache.set(kid, publicKey);\n    return publicKey;\n  }\n}\n```\n\n### Step 3: Configure API Roles\n\n```yaml\n# API Role Configuration in Guidewire Cloud Console\n# Navigate to: Identity & Access > API Roles\n\n# Service Account Role Assignment\nservice_accounts:\n  integration-service:\n    roles:\n      - name: PolicyCenter\n        permissions:\n          - endpoint: \u002Faccount\u002Fv1\u002Faccounts\n            operations: [GET, POST, PATCH]\n          - endpoint: \u002Fjob\u002Fv1\u002Fsubmissions\n            operations: [GET, POST]\n          - endpoint: \u002Fpolicy\u002Fv1\u002Fpolicies\n            operations: [GET]\n\n      - name: ClaimCenter\n        permissions:\n          - endpoint: \u002Fclaim\u002Fv1\u002Fclaims\n            operations: [GET, POST]\n          - endpoint: \u002Ffnol\u002Fv1\u002Ffnol\n            operations: [POST]\n\n  readonly-service:\n    roles:\n      - name: PolicyCenter\n        permissions:\n          - endpoint: \u002Faccount\u002Fv1\u002Faccounts\n            operations: [GET]\n          - endpoint: \u002Fpolicy\u002Fv1\u002Fpolicies\n            operations: [GET]\n```\n\n### Step 4: Secure Gosu Coding\n\n```gosu\n\u002F\u002F Secure Gosu coding practices\npackage gw.security\n\nuses gw.api.util.Logger\nuses gw.api.system.PLSecurityRules\n\nclass SecureCodingPractices {\n  private static final var LOG = Logger.forCategory(\"Security\")\n\n  \u002F\u002F Input validation\n  static function validateInput(input : String, maxLength : int = 255) : String {\n    if (input == null) {\n      throw new IllegalArgumentException(\"Input cannot be null\")\n    }\n\n    \u002F\u002F Remove potentially dangerous characters\n    var sanitized = input\n      .replaceAll(\"[\u003C>\\\"'%;)(&+]\", \"\")\n      .trim()\n\n    if (sanitized.length() > maxLength) {\n      throw new IllegalArgumentException(\"Input exceeds maximum length\")\n    }\n\n    return sanitized\n  }\n\n  \u002F\u002F SQL Injection Prevention - Always use Query API\n  \u002F\u002F BAD: String concatenation\n  static function findAccountBad(accountNumber : String) : Account {\n    \u002F\u002F NEVER DO THIS - SQL Injection vulnerability!\n    \u002F\u002F var sql = \"SELECT * FROM Account WHERE AccountNumber = '\" + accountNumber + \"'\"\n    return null\n  }\n\n  \u002F\u002F GOOD: Use Query API with parameterized queries\n  static function findAccountGood(accountNumber : String) : Account {\n    return Query.make(Account)\n      .compare(Account#AccountNumber, Equals, validateInput(accountNumber))\n      .select()\n      .AtMostOneRow\n  }\n\n  \u002F\u002F Sensitive data handling\n  static function maskSSN(ssn : String) : String {\n    if (ssn == null || ssn.length() \u003C 4) {\n      return \"***-**-****\"\n    }\n    return \"***-**-\" + ssn.substring(ssn.length() - 4)\n  }\n\n  \u002F\u002F Audit logging for sensitive operations\n  static function auditSecurityEvent(\n    action : String,\n    resource : String,\n    success : boolean,\n    details : String = null\n  ) {\n    var user = gw.api.web.SessionUtil.CurrentUser\n    var message = \"SECURITY_AUDIT: action=${action}, resource=${resource}, \" +\n                  \"user=${user.PublicID}, success=${success}\"\n    if (details != null) {\n      message += \", details=${details}\"\n    }\n\n    if (success) {\n      LOG.info(message)\n    } else {\n      LOG.warn(message)\n    }\n  }\n\n  \u002F\u002F Check permissions before operations\n  static function checkPermission(permission : String) {\n    if (!PLSecurityRules.hasPermission(permission)) {\n      auditSecurityEvent(\"ACCESS_DENIED\", permission, false)\n      throw new SecurityException(\"Permission denied: ${permission}\")\n    }\n  }\n}\n```\n\n### Step 5: Data Encryption\n\n```gosu\n\u002F\u002F Encrypt sensitive data at rest\npackage gw.security.encryption\n\nuses javax.crypto.Cipher\nuses javax.crypto.spec.SecretKeySpec\nuses javax.crypto.spec.IvParameterSpec\nuses java.util.Base64\nuses gw.api.util.Logger\n\nclass DataEncryption {\n  private static final var LOG = Logger.forCategory(\"Encryption\")\n  private static final var ALGORITHM = \"AES\u002FCBC\u002FPKCS5Padding\"\n  private static final var KEY_ALGORITHM = \"AES\"\n\n  private var _secretKey : SecretKeySpec\n  private var _iv : IvParameterSpec\n\n  construct(keyBase64 : String, ivBase64 : String) {\n    var keyBytes = Base64.getDecoder().decode(keyBase64)\n    var ivBytes = Base64.getDecoder().decode(ivBase64)\n\n    _secretKey = new SecretKeySpec(keyBytes, KEY_ALGORITHM)\n    _iv = new IvParameterSpec(ivBytes)\n  }\n\n  function encrypt(plainText : String) : String {\n    try {\n      var cipher = Cipher.getInstance(ALGORITHM)\n      cipher.init(Cipher.ENCRYPT_MODE, _secretKey, _iv)\n      var encrypted = cipher.doFinal(plainText.getBytes(\"UTF-8\"))\n      return Base64.getEncoder().encodeToString(encrypted)\n    } catch (e : Exception) {\n      LOG.error(\"Encryption failed\", e)\n      throw new SecurityException(\"Encryption failed\", e)\n    }\n  }\n\n  function decrypt(encryptedText : String) : String {\n    try {\n      var cipher = Cipher.getInstance(ALGORITHM)\n      cipher.init(Cipher.DECRYPT_MODE, _secretKey, _iv)\n      var decoded = Base64.getDecoder().decode(encryptedText)\n      var decrypted = cipher.doFinal(decoded)\n      return new String(decrypted, \"UTF-8\")\n    } catch (e : Exception) {\n      LOG.error(\"Decryption failed\", e)\n      throw new SecurityException(\"Decryption failed\", e)\n    }\n  }\n}\n\n\u002F\u002F Usage for PII storage\nclass PIIHandler {\n  private static var _encryption = new DataEncryption(\n    ScriptParameters.EncryptionKey,\n    ScriptParameters.EncryptionIV\n  )\n\n  static function storeSSN(contact : Contact, ssn : String) {\n    contact.EncryptedSSN = _encryption.encrypt(ssn)\n    \u002F\u002F Clear unencrypted field if it exists\n    contact.SSN = null\n  }\n\n  static function retrieveSSN(contact : Contact) : String {\n    if (contact.EncryptedSSN != null) {\n      return _encryption.decrypt(contact.EncryptedSSN)\n    }\n    return null\n  }\n}\n```\n\n### Step 6: Secure API Endpoints\n\n```typescript\n\u002F\u002F Secure API middleware\nimport { Request, Response, NextFunction } from 'express';\n\ninterface SecurityContext {\n  userId: string;\n  roles: string[];\n  permissions: string[];\n  tenantId: string;\n}\n\n\u002F\u002F Extract and validate security context\nasync function securityMiddleware(\n  req: Request,\n  res: Response,\n  next: NextFunction\n): Promise\u003Cvoid> {\n  try {\n    const authHeader = req.headers.authorization;\n    if (!authHeader?.startsWith('Bearer ')) {\n      res.status(401).json({ error: 'Missing authorization header' });\n      return;\n    }\n\n    const token = authHeader.substring(7);\n    const validator = new JWTValidator({\n      issuer: process.env.GW_HUB_URL!,\n      audience: process.env.GW_CLIENT_ID!,\n      jwksUri: `${process.env.GW_HUB_URL}\u002F.well-known\u002Fjwks.json`\n    });\n\n    const payload = await validator.validateToken(token);\n\n    \u002F\u002F Attach security context to request\n    (req as any).securityContext = {\n      userId: payload.sub,\n      roles: payload.roles || [],\n      permissions: payload.permissions || [],\n      tenantId: payload.tenant_id\n    } as SecurityContext;\n\n    next();\n  } catch (error) {\n    console.error('Authentication failed:', error);\n    res.status(401).json({ error: 'Invalid or expired token' });\n  }\n}\n\n\u002F\u002F Role-based access control middleware\nfunction requireRole(...roles: string[]) {\n  return (req: Request, res: Response, next: NextFunction) => {\n    const context = (req as any).securityContext as SecurityContext;\n\n    if (!context) {\n      res.status(401).json({ error: 'Not authenticated' });\n      return;\n    }\n\n    const hasRole = roles.some(role => context.roles.includes(role));\n    if (!hasRole) {\n      res.status(403).json({\n        error: 'Forbidden',\n        requiredRoles: roles,\n        userRoles: context.roles\n      });\n      return;\n    }\n\n    next();\n  };\n}\n\n\u002F\u002F Usage\napp.get('\u002Fapi\u002Fpolicies',\n  securityMiddleware,\n  requireRole('policy_read', 'policy_admin'),\n  async (req, res) => {\n    \u002F\u002F Handle request\n  }\n);\n```\n\n## Security Checklist\n\n| Category | Check | Status |\n|----------|-------|--------|\n| Authentication | OAuth2 client credentials flow | Required |\n| Authentication | JWT token validation | Required |\n| Authentication | Token refresh before expiry | Required |\n| Authorization | API roles configured | Required |\n| Authorization | Least privilege principle | Required |\n| Data Protection | PII encryption at rest | Required |\n| Data Protection | TLS 1.2+ in transit | Required |\n| Input Validation | All inputs sanitized | Required |\n| Logging | Security events audited | Required |\n| Secrets | No hardcoded credentials | Required |\n\n## Output\n\n- Secure OAuth2 token management\n- JWT validation for incoming requests\n- API role configuration\n- Secure Gosu coding patterns\n- Data encryption implementation\n\n## Resources\n\n- [Guidewire Security Documentation](https:\u002F\u002Fdocs.guidewire.com\u002Fsecurity\u002F)\n- [Gosu Secure Coding Guidelines](https:\u002F\u002Fdocs.guidewire.com\u002Fsecurity\u002Fgosu-secure-coding-guidelines\u002F)\n- [Cloud API Authentication](https:\u002F\u002Fdocs.guidewire.com\u002Fcloud\u002Fpc\u002F202503\u002Fcloudapica\u002F)\n\n## Next Steps\n\nFor production readiness, see `guidewire-prod-checklist`.\n","# Guidewire Security Basics\n\n## Overview\n\nImplement comprehensive security for Guidewire InsuranceSuite including OAuth2 authentication, JWT token management, API role configuration, and secure Gosu coding practices.\n\n## Prerequisites\n\n- Access to Guidewire Cloud Console (GCC)\n- Understanding of OAuth2 and JWT concepts\n- Familiarity with Gosu programming\n\n## Authentication Architecture\n\n```\n+------------------+      +------------------+      +------------------+\n|                  |      |                  |      |                  |\n|  Client App      |----->|  Guidewire Hub   |----->|  InsuranceSuite  |\n|  (Frontend\u002FAPI)  |      |  (IdP)           |      |  Cloud API       |\n|                  |      |                  |      |                  |\n+------------------+      +------------------+      +------------------+\n        |                         |                         |\n        |  1. Auth Request        |                         |\n        |------------------------>|                         |\n        |                         |                         |\n        |  2. JWT Token           |                         |\n        |\u003C------------------------|                         |\n        |                         |                         |\n        |  3. API Call + JWT      |                         |\n        |-------------------------------------------------->|\n        |                         |                         |\n        |  4. Validate JWT        |\u003C------------------------|\n        |                         |                         |\n        |  5. Response            |                         |\n        |\u003C--------------------------------------------------|\n```\n\n## Instructions\n\n### Step 1: Secure OAuth2 Implementation\n\n```typescript\n\u002F\u002F Secure token management\ninterface TokenConfig {\n  clientId: string;\n  clientSecret: string;\n  hubUrl: string;\n  scope: string;\n}\n\nclass SecureTokenManager {\n  private token: string | null = null;\n  private tokenExpiry: Date | null = null;\n  private refreshPromise: Promise\u003Cstring> | null = null;\n\n  constructor(private config: TokenConfig) {}\n\n  async getToken(): Promise\u003Cstring> {\n    \u002F\u002F Return cached token if valid\n    if (this.isTokenValid()) {\n      return this.token!;\n    }\n\n    \u002F\u002F Prevent concurrent refresh requests\n    if (this.refreshPromise) {\n      return this.refreshPromise;\n    }\n\n    this.refreshPromise = this.refreshToken();\n    try {\n      const token = await this.refreshPromise;\n      return token;\n    } finally {\n      this.refreshPromise = null;\n    }\n  }\n\n  private async refreshToken(): Promise\u003Cstring> {\n    const response = await fetch(`${this.config.hubUrl}\u002Foauth\u002Ftoken`, {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application\u002Fx-www-form-urlencoded'\n      },\n      body: new URLSearchParams({\n        grant_type: 'client_credentials',\n        client_id: this.config.clientId,\n        client_secret: this.config.clientSecret,\n        scope: this.config.scope\n      })\n    });\n\n    if (!response.ok) {\n      throw new Error(`Token refresh failed: ${response.status}`);\n    }\n\n    const data = await response.json();\n    this.token = data.access_token;\n    \u002F\u002F Set expiry with 60-second buffer\n    this.tokenExpiry = new Date(Date.now() + (data.expires_in - 60) * 1000);\n\n    return this.token;\n  }\n\n  private isTokenValid(): boolean {\n    return this.token !== null &&\n           this.tokenExpiry !== null &&\n           this.tokenExpiry > new Date();\n  }\n\n  \u002F\u002F Securely clear tokens\n  clearTokens(): void {\n    this.token = null;\n    this.tokenExpiry = null;\n  }\n}\n```\n\n### Step 2: JWT Validation\n\n```typescript\n\u002F\u002F Validate JWT tokens (for webhook receivers or internal services)\nimport jwt from 'jsonwebtoken';\nimport jwksClient from 'jwks-rsa';\n\ninterface JWTValidationConfig {\n  issuer: string;\n  audience: string;\n  jwksUri: string;\n}\n\nclass JWTValidator {\n  private jwksClient: jwksClient.JwksClient;\n  private keyCache: Map\u003Cstring, string> = new Map();\n\n  constructor(private config: JWTValidationConfig) {\n    this.jwksClient = jwksClient({\n      jwksUri: config.jwksUri,\n      cache: true,\n      cacheMaxAge: 600000, \u002F\u002F 10 minutes\n      rateLimit: true\n    });\n  }\n\n  async validateToken(token: string): Promise\u003Cjwt.JwtPayload> {\n    const decoded = jwt.decode(token, { complete: true });\n    if (!decoded || !decoded.header.kid) {\n      throw new Error('Invalid token format');\n    }\n\n    const publicKey = await this.getSigningKey(decoded.header.kid);\n\n    return new Promise((resolve, reject) => {\n      jwt.verify(\n        token,\n        publicKey,\n        {\n          issuer: this.config.issuer,\n          audience: this.config.audience,\n          algorithms: ['RS256']\n        },\n        (err, payload) => {\n          if (err) {\n            reject(new Error(`Token validation failed: ${err.message}`));\n          } else {\n            resolve(payload as jwt.JwtPayload);\n          }\n        }\n      );\n    });\n  }\n\n  private async getSigningKey(kid: string): Promise\u003Cstring> {\n    if (this.keyCache.has(kid)) {\n      return this.keyCache.get(kid)!;\n    }\n\n    const key = await this.jwksClient.getSigningKey(kid);\n    const publicKey = key.getPublicKey();\n    this.keyCache.set(kid, publicKey);\n    return publicKey;\n  }\n}\n```\n\n### Step 3: Configure API Roles\n\n```yaml\n# API Role Configuration in Guidewire Cloud Console\n# Navigate to: Identity & Access > API Roles\n\n# Service Account Role Assignment\nservice_accounts:\n  integration-service:\n    roles:\n      - name: PolicyCenter\n        permissions:\n          - endpoint: \u002Faccount\u002Fv1\u002Faccounts\n            operations: [GET, POST, PATCH]\n          - endpoint: \u002Fjob\u002Fv1\u002Fsubmissions\n            operations: [GET, POST]\n          - endpoint: \u002Fpolicy\u002Fv1\u002Fpolicies\n            operations: [GET]\n\n      - name: ClaimCenter\n        permissions:\n          - endpoint: \u002Fclaim\u002Fv1\u002Fclaims\n            operations: [GET, POST]\n          - endpoint: \u002Ffnol\u002Fv1\u002Ffnol\n            operations: [POST]\n\n  readonly-service:\n    roles:\n      - name: PolicyCenter\n        permissions:\n          - endpoint: \u002Faccount\u002Fv1\u002Faccounts\n            operations: [GET]\n          - endpoint: \u002Fpolicy\u002Fv1\u002Fpolicies\n            operations: [GET]\n```\n\n### Step 4: Secure Gosu Coding\n\n```gosu\n\u002F\u002F Secure Gosu coding practices\npackage gw.security\n\nuses gw.api.util.Logger\nuses gw.api.system.PLSecurityRules\n\nclass SecureCodingPractices {\n  private static final var LOG = Logger.forCategory(\"Security\")\n\n  \u002F\u002F Input validation\n  static function validateInput(input : String, maxLength : int = 255) : String {\n    if (input == null) {\n      throw new IllegalArgumentException(\"Input cannot be null\")\n    }\n\n    \u002F\u002F Remove potentially dangerous characters\n    var sanitized = input\n      .replaceAll(\"[\u003C>\\\"'%;)(&+]\", \"\")\n      .trim()\n\n    if (sanitized.length() > maxLength) {\n      throw new IllegalArgumentException(\"Input exceeds maximum length\")\n    }\n\n    return sanitized\n  }\n\n  \u002F\u002F SQL Injection Prevention - Always use Query API\n  \u002F\u002F BAD: String concatenation\n  static function findAccountBad(accountNumber : String) : Account {\n    \u002F\u002F NEVER DO THIS - SQL Injection vulnerability!\n    \u002F\u002F var sql = \"SELECT * FROM Account WHERE AccountNumber = '\" + accountNumber + \"'\"\n    return null\n  }\n\n  \u002F\u002F GOOD: Use Query API with parameterized queries\n  static function findAccountGood(accountNumber : String) : Account {\n    return Query.make(Account)\n      .compare(Account#AccountNumber, Equals, validateInput(accountNumber))\n      .select()\n      .AtMostOneRow\n  }\n\n  \u002F\u002F Sensitive data handling\n  static function maskSSN(ssn : String) : String {\n    if (ssn == null || ssn.length() \u003C 4) {\n      return \"***-**-****\"\n    }\n    return \"***-**-\" + ssn.substring(ssn.length() - 4)\n  }\n\n  \u002F\u002F Audit logging for sensitive operations\n  static function auditSecurityEvent(\n    action : String,\n    resource : String,\n    success : boolean,\n    details : String = null\n  ) {\n    var user = gw.api.web.SessionUtil.CurrentUser\n    var message = \"SECURITY_AUDIT: action=${action}, resource=${resource}, \" +\n                  \"user=${user.PublicID}, success=${success}\"\n    if (details != null) {\n      message += \", details=${details}\"\n    }\n\n    if (success) {\n      LOG.info(message)\n    } else {\n      LOG.warn(message)\n    }\n  }\n\n  \u002F\u002F Check permissions before operations\n  static function checkPermission(permission : String) {\n    if (!PLSecurityRules.hasPermission(permission)) {\n      auditSecurityEvent(\"ACCESS_DENIED\", permission, false)\n      throw new SecurityException(\"Permission denied: ${permission}\")\n    }\n  }\n}\n```\n\n### Step 5: Data Encryption\n\n```gosu\n\u002F\u002F Encrypt sensitive data at rest\npackage gw.security.encryption\n\nuses javax.crypto.Cipher\nuses javax.crypto.spec.SecretKeySpec\nuses javax.crypto.spec.IvParameterSpec\nuses java.util.Base64\nuses gw.api.util.Logger\n\nclass DataEncryption {\n  private static final var LOG = Logger.forCategory(\"Encryption\")\n  private static final var ALGORITHM = \"AES\u002FCBC\u002FPKCS5Padding\"\n  private static final var KEY_ALGORITHM = \"AES\"\n\n  private var _secretKey : SecretKeySpec\n  private var _iv : IvParameterSpec\n\n  construct(keyBase64 : String, ivBase64 : String) {\n    var keyBytes = Base64.getDecoder().decode(keyBase64)\n    var ivBytes = Base64.getDecoder().decode(ivBase64)\n\n    _secretKey = new SecretKeySpec(keyBytes, KEY_ALGORITHM)\n    _iv = new IvParameterSpec(ivBytes)\n  }\n\n  function encrypt(plainText : String) : String {\n    try {\n      var cipher = Cipher.getInstance(ALGORITHM)\n      cipher.init(Cipher.ENCRYPT_MODE, _secretKey, _iv)\n      var encrypted = cipher.doFinal(plainText.getBytes(\"UTF-8\"))\n      return Base64.getEncoder().encodeToString(encrypted)\n    } catch (e : Exception) {\n      LOG.error(\"Encryption failed\", e)\n      throw new SecurityException(\"Encryption failed\", e)\n    }\n  }\n\n  function decrypt(encryptedText : String) : String {\n    try {\n      var cipher = Cipher.getInstance(ALGORITHM)\n      cipher.init(Cipher.DECRYPT_MODE, _secretKey, _iv)\n      var decoded = Base64.getDecoder().decode(encryptedText)\n      var decrypted = cipher.doFinal(decoded)\n      return new String(decrypted, \"UTF-8\")\n    } catch (e : Exception) {\n      LOG.error(\"Decryption failed\", e)\n      throw new SecurityException(\"Decryption failed\", e)\n    }\n  }\n}\n\n\u002F\u002F Usage for PII storage\nclass PIIHandler {\n  private static var _encryption = new DataEncryption(\n    ScriptParameters.EncryptionKey,\n    ScriptParameters.EncryptionIV\n  )\n\n  static function storeSSN(contact : Contact, ssn : String) {\n    contact.EncryptedSSN = _encryption.encrypt(ssn)\n    \u002F\u002F Clear unencrypted field if it exists\n    contact.SSN = null\n  }\n\n  static function retrieveSSN(contact : Contact) : String {\n    if (contact.EncryptedSSN != null) {\n      return _encryption.decrypt(contact.EncryptedSSN)\n    }\n    return null\n  }\n}\n```\n\n### Step 6: Secure API Endpoints\n\n```typescript\n\u002F\u002F Secure API middleware\nimport { Request, Response, NextFunction } from 'express';\n\ninterface SecurityContext {\n  userId: string;\n  roles: string[];\n  permissions: string[];\n  tenantId: string;\n}\n\n\u002F\u002F Extract and validate security context\nasync function securityMiddleware(\n  req: Request,\n  res: Response,\n  next: NextFunction\n): Promise\u003Cvoid> {\n  try {\n    const authHeader = req.headers.authorization;\n    if (!authHeader?.startsWith('Bearer ')) {\n      res.status(401).json({ error: 'Missing authorization header' });\n      return;\n    }\n\n    const token = authHeader.substring(7);\n    const validator = new JWTValidator({\n      issuer: process.env.GW_HUB_URL!,\n      audience: process.env.GW_CLIENT_ID!,\n      jwksUri: `${process.env.GW_HUB_URL}\u002F.well-known\u002Fjwks.json`\n    });\n\n    const payload = await validator.validateToken(token);\n\n    \u002F\u002F Attach security context to request\n    (req as any).securityContext = {\n      userId: payload.sub,\n      roles: payload.roles || [],\n      permissions: payload.permissions || [],\n      tenantId: payload.tenant_id\n    } as SecurityContext;\n\n    next();\n  } catch (error) {\n    console.error('Authentication failed:', error);\n    res.status(401).json({ error: 'Invalid or expired token' });\n  }\n}\n\n\u002F\u002F Role-based access control middleware\nfunction requireRole(...roles: string[]) {\n  return (req: Request, res: Response, next: NextFunction) => {\n    const context = (req as any).securityContext as SecurityContext;\n\n    if (!context) {\n      res.status(401).json({ error: 'Not authenticated' });\n      return;\n    }\n\n    const hasRole = roles.some(role => context.roles.includes(role));\n    if (!hasRole) {\n      res.status(403).json({\n        error: 'Forbidden',\n        requiredRoles: roles,\n        userRoles: context.roles\n      });\n      return;\n    }\n\n    next();\n  };\n}\n\n\u002F\u002F Usage\napp.get('\u002Fapi\u002Fpolicies',\n  securityMiddleware,\n  requireRole('policy_read', 'policy_admin'),\n  async (req, res) => {\n    \u002F\u002F Handle request\n  }\n);\n```\n\n## Security Checklist\n\n| Category | Check | Status |\n|----------|-------|--------|\n| Authentication | OAuth2 client credentials flow | Required |\n| Authentication | JWT token validation | Required |\n| Authentication | Token refresh before expiry | Required |\n| Authorization | API roles configured | Required |\n| Authorization | Least privilege principle | Required |\n| Data Protection | PII encryption at rest | Required |\n| Data Protection | TLS 1.2+ in transit | Required |\n| Input Validation | All inputs sanitized | Required |\n| Logging | Security events audited | Required |\n| Secrets | No hardcoded credentials | Required |\n\n## Output\n\n- Secure OAuth2 token management\n- JWT validation for incoming requests\n- API role configuration\n- Secure Gosu coding patterns\n- Data encryption implementation\n\n## Resources\n\n- [Guidewire Security Documentation](https:\u002F\u002Fdocs.guidewire.com\u002Fsecurity\u002F)\n- [Gosu Secure Coding Guidelines](https:\u002F\u002Fdocs.guidewire.com\u002Fsecurity\u002Fgosu-secure-coding-guidelines\u002F)\n- [Cloud API Authentication](https:\u002F\u002Fdocs.guidewire.com\u002Fcloud\u002Fpc\u002F202503\u002Fcloudapica\u002F)\n\n## Next Steps\n\nFor production readiness, see `guidewire-prod-checklist`.\n",{"name":5,"author":48,"license":15,"version":49,"description":50,"allowed-tools":51},"Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Implement security best practices for Guidewire InsuranceSuite including OAuth2,\nJWT handling, API roles, secure Gosu coding, and data protection.\nTrigger with phrases like \"guidewire security\", \"oauth2 guidewire\",\n\"jwt token\", \"api roles\", \"secure gosu code\", \"guidewire authentication\".\n","Read, Write, Edit, Bash(curl:*), Grep","main","90b50ed0778745a80fd5bfb13b1843d45b9e82f7","tests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fguidewire-pack\u002Fskills\u002Fguidewire-security-basics",233,"https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust","https:\u002F\u002Fgithub.com\u002FDicklesworthstone","https:\u002F\u002Fwww.jeffreyemanuel.com\u002F","Building in NY","2026-11-15 01:54:15",{"source":8,"skillName":5,"commands":62,"prompt":72,"zipAvailable":73},[63,66,69],{"tool":64,"command":65},"npx","npx skills add Dicklesworthstone\u002Fpi_agent_rust --skill guidewire-security-basics",{"tool":67,"command":68},"bunx","bunx skills add Dicklesworthstone\u002Fpi_agent_rust --skill guidewire-security-basics",{"tool":70,"command":71},"pnpm","pnpm dlx skills add Dicklesworthstone\u002Fpi_agent_rust --skill guidewire-security-basics","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fguidewire-pack\u002Fskills\u002Fguidewire-security-basics\u002FSKILL.md",true,[],[76,104,136,155,181,205],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":81,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":103},"01M6FCR7G5A005P364Z6ZWCJDP","theme-factory","Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors\u002Ffonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fcreative-design\u002Ftheme-factory\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fcreative-design\u002Ftheme-factory\u002FSKILL.md",[],[85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,24,101,102],"theme factory","factory","theme","docs","toolkit","generate","artifacts","SET","fly","slides","landing","html","styling","artifact","pages","themes","you","fonts","2026-11-11 15:11:14",{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":108,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":43},"01M6FEGPPK0ZTKCCM0R3E3KS33","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FSKILL.md",[],[112,113,91,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,96,130,131,132,133,23,134,135],"web artifacts builder","web","artifacts builder","builder","frontend","css","components","react","component","routing","state management","state","shadcn","file","ui","Tools","Tailwind","use","single-file","simple","ui components","multi","jsx","suite",{"skillNo":137,"name":138,"nameZh":6,"description":139,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":140,"sourceHtmlUrl":141,"categories":142,"keywords":143,"publishedAt":43},"01M6FEE9VTK1W4GY21AKREJXRG","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FSKILL.md",[],[144,145,146,116,147,148,113,149,89,150,126,151,152,153,154,24,23],"testing","webapp testing","webapp","screenshots","playwright","debugging","browser","logs","applications","behavior","local",{"skillNo":156,"name":157,"nameZh":6,"description":158,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":159,"sourceHtmlUrl":160,"categories":161,"keywords":162,"publishedAt":43},"01M6FE20F7ZTQBFWKF4MPJ2SBX","neuropixels-analysis","Neuropixels neural recording analysis. Load SpikeGLX\u002FOpenEphys data, preprocess, motion correction, Kilosort4 spike sorting, quality metrics, Allen\u002FIBL curation, AI-assisted visual analysis, for Neuropixels 1.0\u002F2.0 extracellular electrophysiology. Use when working with neural recordings, spike sorting, extracellular electrophysiology, or when the user mentions Neuropixels, SpikeGLX, Open Ephys, Kilosort, quality metrics, or unit curation.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fneuropixels-analysis\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fneuropixels-analysis\u002FSKILL.md",[],[163,164,165,166,35,167,168,169,129,170,171,172,173,174,175,176,24,177,178,179,23,180],"analysis","neuropixels analysis","spike","metrics","open","quality","user","recordings","Neural","motion","visual","quality metrics","unit","sorting","curation","recording","load","when",{"skillNo":182,"name":183,"nameZh":6,"description":184,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":185,"sourceHtmlUrl":186,"categories":187,"keywords":188,"publishedAt":43},"01M6FDP0PDK6F1GGX395C7625Z","skill-creator","Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fskill-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fskill-creator\u002FSKILL.md",[],[189,190,191,192,193,194,195,196,197,198,199,200,201,202,24,23,203,180,204],"skill creator","creator","workflows","create","update","capabilities","knowledge","tool","integrations","specialized","guide","new skill","existing skill","users","Existing","new",{"skillNo":206,"name":207,"nameZh":6,"description":208,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":209,"sourceHtmlUrl":210,"categories":211,"keywords":212,"publishedAt":43},"01M6FDM8Y7VK7NYG9SM7QPA3PW","notebooklm","Use this skill to query your Google NotebookLM notebooks directly from Claude Code for source-grounded, citation-backed answers from Gemini. Browser automation, library management, persistent auth. Drastically reduced hallucinations through document-only responses.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fnotebooklm\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fnotebooklm\u002FSKILL.md",[],[207,213,214,215,216,217,40,150,218,219,129,220,221,222,223,23,224],"google","browser automation","gemini","automation","auth","library","management","only","document","query","Citation","source"]