I see repeated reference to improvisation in Javanese and Balinese gamelan music but I don't see any reference to the actual rules of improvisation in that music.
What are the rules of improvisation in gamelan music?
According to this site, Improvisation in Gamelan is not the same as in the west:
Some remarks should be made regarding the term improvisation. In the West, the word improvisation is synonymous with ad lib, which implies a great deal more freedom than is allowed Javanese musicians. In jazz, the improvising musicians are sometimes known "to fake," a term that does not conjure up a particularly positive image. There are many Javanese terms that may be translated loosely as improvisation: kembangan (literally "flowering"), improvisation that adds beauty; isen–isen ("filling"), improvisation that pleasantly fills a vacuum; ngambang ("floating"), improvisation produced by musicians who do not have a clear knowledge of where the music is going; sambang–rapet ("making a tight connection"), covering up a fellow performer's mistake in order to save him or her from embarrassment; and finally, ngawur ("blunder"), an out–of–style or irrelevant improvisation. In the performance of Javanese music, improvisatory parts should be of the kembangan, isen–isen, or sambang–rape type. Occasional ngambang is tolerated, but not ngawur.
Kwabena Nketia, an African ethnomusicologist, once remarked that in traditional performing arts, the renewal of past artistic experience is expected. The role of an artist is to shed new light and to intensify the experiences that the audience wishes to renew. Insufficient innovation tends to bore the audience; too much innovation destroys the pleasant memory of the art work, possibly resulting in the audience's displeasure with the interpretation. A "good" performing artist, then is one who knows the borderline between "too much" and "not enough," a fine line that is often very personal indeed. Such is the case with Javanese music.